⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.133
Server IP:
185.119.109.197
Server:
Linux managedhosting.chostar.me 5.15.0-160-generic #170-Ubuntu SMP Wed Oct 1 10:06:56 UTC 2025 x86_64
Server Software:
Apache
PHP Version:
8.1.33
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
proc
/
self
/
root
/
usr
/
share
/
ri
/
3.0.0
/
system
/
Hash
/
View File Name :
transform_keys-i.ri
U:RDoc::AnyMethod[iI"transform_keys:ETI"Hash#transform_keys;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"0Returns a new \Hash object; each entry has:;To:RDoc::Markup::List: @type:BULLET:@items[o:RDoc::Markup::ListItem:@label0; [o; ; [I"!A key provided by the block.;To;;0; [o; ; [I"The value from +self+.;To:RDoc::Markup::BlankLine o; ; [I"HAn optional hash argument can be provided to map keys to new keys. ;TI"@Any key not given will be mapped using the provided block, ;TI"-or remain the same if no block is given.;T@o; ; [I"Transform keys:;To:RDoc::Markup::Verbatim; [I""h = {foo: 0, bar: 1, baz: 2} ;TI"-h1 = h.transform_keys {|key| key.to_s } ;TI",h1 # => {"foo"=>0, "bar"=>1, "baz"=>2} ;TI" ;TI",h.transform_keys(foo: :bar, bar: :foo) ;TI""#=> {bar: 0, foo: 1, baz: 2} ;TI" ;TI"+h.transform_keys(foo: :hello, &:to_s) ;TI")#=> {:hello=>0, "bar"=>1, "baz"=>2} ;T:@format0o; ; [I"*Overwrites values for duplicate keys:;To;; [I""h = {foo: 0, bar: 1, baz: 2} ;TI")h1 = h.transform_keys {|key| :bat } ;TI"h1 # => {:bat=>2} ;T;0o; ; [I"1Returns a new \Enumerator if no block given:;To;; [ I""h = {foo: 0, bar: 1, baz: 2} ;TI"Ye = h.transform_keys # => #
0, :bar=>1, :baz=>2}:transform_keys> ;TI"$h1 = e.each { |key| key.to_s } ;TI"+h1 # => {"foo"=>0, "bar"=>1, "baz"=>2};T;0: @fileI"hash.c;T:0@omit_headings_from_table_of_contents_below0I"³hash.transform_keys {|key| ... } -> new_hash hash.transform_keys(hash2) -> new_hash hash.transform_keys(hash2) {|other_key| ...} -> new_hash hash.transform_keys -> new_enumerator ;T0[ I"(*args);T@?FI" Hash;TcRDoc::NormalClass00