RubyのcloneとdupとActiveRecordのcloneとdupは別物なのでしょうか? 同じものです。Method#owner でメソッドが定義されたクラスが得られますが、下記のいずれも true になります。 Piyo.new.method(:clone).owner == Object.method(:clone).owner` Piyo.new.method(:dup).owner == Object.method(:dup).owner` ただし、clone の場合は initialize_clone、dup の場合は initialize_dup メソッドが呼ばれます (参考: initialize_clone, initialize_dup and initialize_copy in Ruby: Jon Leighton)。 ActiveRecord の場合、Act
Ruby on Rails 8.0.2 Class ActiveSupport::HashWithIndifferentAccess < Hash activesupport/lib/active_support/hash_with_indifferent_access.rb Hash With Indifferent Access Implements a hash where keys :foo and "foo" are considered to be the same. rgb = ActiveSupport::HashWithIndifferentAccess.new rgb[:black] = '#000000' rgb[:black] # => '#000000' rgb['black'] # => '#000000' rgb['white'] = '#FFFFFF' rg
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く