Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1 @@
{:name => 'Zeus', :planet => 'Jupiter'}

View file

@ -0,0 +1 @@
{name: 'Zeus', planet: 'Jupiter'}

View file

@ -0,0 +1 @@
{1 => 'two', three: 4}

View file

@ -0,0 +1,4 @@
hash = {}
hash[666] = 'devil'
hash[777] # => nil
hash[666] # => 'devil'

View file

@ -0,0 +1,4 @@
hash = Hash.new('unknown key')
hash[666] = 'devil'
hash[777] # => 'unknown key'
hash[666] # => 'devil'

View file

@ -0,0 +1,4 @@
hash = Hash.new { |h, k| "unknown key #{k}" }
hash[666] = 'devil'
hash[777] # => 'unknown key 777'
hash[666] # => 'devil'

View file

@ -0,0 +1,4 @@
hash = Hash.new { |h, k| h[k] = "key #{k} was added at #{Time.now}" }
hash[777] # => 'key 777 was added at Sun Apr 03 13:49:57 -0700 2011'
hash[555] # => 'key 555 was added at Sun Apr 03 13:50:01 -0700 2011'
hash[777] # => 'key 777 was added at Sun Apr 03 13:49:57 -0700 2011'