@@ -1573,22 +1573,22 @@ h.transform_values!.with_index {|v, i| "#{v}.#{i}" }
15731573@see [[m:Hash#transform_keys]]
15741574@see [[m:Hash#transform_keys!]]
15751575--- transform_keys {|key| ... } -> Hash
1576- #@since 3.0.0
1576+ #@since 3.0
15771577--- transform_keys(hash) -> Hash
15781578#@end
15791579--- transform_keys -> Enumerator
15801580
15811581すべてのキーに対してブロックを呼び出した結果で置き換えたハッシュを返します。
15821582値は変化しません。
15831583
1584- #@since 3.0.0
1584+ #@since 3.0
15851585@param hash 置き換え前のキーから置き換え後のキーへのハッシュを指定します。
15861586#@end
15871587
15881588#@samplecode 例
15891589h = { a: 1, b: 2, c: 3 }
15901590h.transform_keys {|k| k.to_s } # => {"a"=>1, "b"=>2, "c"=>3}
1591- #@since 3.0.0
1591+ #@since 3.0
15921592h.transform_keys(a: "a", d: "d") # => {"a"=>1, :b=>2, :c=>3}
15931593#@end
15941594h.transform_keys(&:to_s) # => {"a"=>1, "b"=>2, "c"=>3}
@@ -1601,15 +1601,15 @@ h.transform_keys.with_index {|k, i| "#{k}.#{i}" }
16011601@see [[m:Hash#transform_values!]]
16021602
16031603--- transform_keys! {|key| ... } -> self
1604- #@since 3.0.0
1604+ #@since 3.0
16051605--- transform_keys!(hash) -> self
16061606#@end
16071607--- transform_keys! -> Enumerator
16081608
16091609すべてのキーに対してブロックを呼び出した結果でハッシュのキーを変更します。
16101610値は変化しません。
16111611
1612- #@since 3.0.0
1612+ #@since 3.0
16131613@param hash 置き換え前のキーから置き換え後のキーへのハッシュを指定します。
16141614#@end
16151615@return transform_keys! は常に self を返します。
@@ -1621,7 +1621,7 @@ h.transform_keys.with_index {|k, i| "#{k}.#{i}" }
16211621h = { a: 1, b: 2, c: 3 }
16221622h.transform_keys! {|k| k.to_s } # => {"a"=>1, "b"=>2, "c"=>3}
16231623h.transform_keys!(&:to_sym) # => {:a=>1, :b=>2, :c=>3}
1624- #@since 3.0.0
1624+ #@since 3.0
16251625h.transform_keys!(a: "a", d: "d") # => {"a"=>1, :b=>2, :c=>3}
16261626#@end
16271627h.transform_keys!.with_index {|k, i| "#{k}.#{i}" }
@@ -1643,13 +1643,13 @@ h.slice(:c, :b) # => {:c=>300, :b=>200}
16431643h.slice(:b, :c, :d) # => {:b=>200, :c=>300}
16441644#@end
16451645
1646- #@since 3.0.0
1646+ #@since 3.0
16471647@see [[m:Hash#except]], [[m:ENV.slice]]
16481648#@else
16491649@see [[m:ENV.slice]]
16501650#@end
16511651#@end
1652- #@since 3.0.0
1652+ #@since 3.0
16531653--- except(*keys) -> Hash
16541654
16551655引数で指定された以外のキーとその値だけを含む Hash を返します。
0 commit comments