This is a Ruby tree! It shows every object from the Ruby Programming Language in a tree format.
# Array.to_h (from ruby core) --- array.to_h -> new_hash array.to_h {|item| ... } -> new_hash --- Returns a new Hash formed from `self`. When a block is given, calls the block with each array element; the block must return a 2-element Array whose two elements form a key-value pair in the returned Hash: a = ['foo', :bar, 1, [2, 3], {baz: 4}] h = a.to_h {|item| [item, item] } h # => {"foo"=>"foo", :bar=>:bar, 1=>1, [2, 3]=>[2, 3], {:baz=>4}=>{:baz=>4}} When no block is given, `self` must be an Array of 2-element sub-arrays, each sub-array is formed into a key-value pair in the new Hash: [].to_h # => {} a = [['foo', 'zero'], ['bar', 'one'], ['baz', 'two']] h = a.to_h h # => {"foo"=>"zero", "bar"=>"one", "baz"=>"two"}
This is MURDOC! A Ruby documentation browser inspired by Smalltalk-80. It allows you to learn about Ruby by browsing through its class hierarchies, and see any of its methods.