This is a Ruby tree! It shows every object from the Ruby Programming Language in a tree format.
# Hash.[] (from ruby core) --- Hash[] -> new_empty_hash Hash[hash] -> new_hash Hash[ [*2_element_arrays] ] -> new_hash Hash[*objects] -> new_hash --- Returns a new Hash object populated with the given objects, if any. See Hash::new. With no argument, returns a new empty Hash. When the single given argument is a Hash, returns a new Hash populated with the entries from the given Hash, excluding the default value or proc. h = {foo: 0, bar: 1, baz: 2} Hash[h] # => {:foo=>0, :bar=>1, :baz=>2} When the single given argument is an Array of 2-element Arrays, returns a new Hash object wherein each 2-element array forms a key-value entry: Hash[ [ [:foo, 0], [:bar, 1] ] ] # => {:foo=>0, :bar=>1} When the argument count is an even number; returns a new Hash object wherein each successive pair of arguments has become a key-value entry: Hash[:foo, 0, :bar, 1] # => {:foo=>0, :bar=>1} Raises an exception if the argument list does not conform to any of the above. (from ruby core) --- hash[key] -> value --- Returns the value associated with the given `key`, if found: h = {foo: 0, bar: 1, baz: 2} h[:foo] # => 0 If `key` is not found, returns a default value (see [Default Values](#class-Hash-label-Default+Values)): h = {foo: 0, bar: 1, baz: 2} h[:nosuch] # => nil
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.