This is a Ruby tree! It shows every object from the Ruby Programming Language in a tree format.

each

        # Hash.each

(from ruby core)
---
    each()

---

Hash#each is an alias for Hash#each_pair.

Calls the given block with each key-value pair; returns `self`:
    h = {foo: 0, bar: 1, baz: 2}
    h.each_pair {|key, value| puts "#{key}: #{value}"} # => {:foo=>0, :bar=>1, :baz=>2}

Output:
    foo: 0
    bar: 1
    baz: 2

Returns a new Enumerator if no block given:
    h = {foo: 0, bar: 1, baz: 2}
    e = h.each_pair # => #<Enumerator: {:foo=>0, :bar=>1, :baz=>2}:each_pair>
    h1 = e.each {|key, value| puts "#{key}: #{value}"}
    h1 # => {:foo=>0, :bar=>1, :baz=>2}

Output:
    foo: 0
    bar: 1
    baz: 2


(This method is an alias for Hash#each_pair.)

Hash#each is an alias for Hash#each_pair.

Calls the given block with each key-value pair; returns `self`:
    h = {foo: 0, bar: 1, baz: 2}
    h.each_pair {|key, value| puts "#{key}: #{value}"} # => {:foo=>0, :bar=>1, :baz=>2}

Output:
    foo: 0
    bar: 1
    baz: 2

Returns a new Enumerator if no block given:
    h = {foo: 0, bar: 1, baz: 2}
    e = h.each_pair # => #<Enumerator: {:foo=>0, :bar=>1, :baz=>2}:each_pair>
    h1 = e.each {|key, value| puts "#{key}: #{value}"}
    h1 # => {:foo=>0, :bar=>1, :baz=>2}

Output:
    foo: 0
    bar: 1
    baz: 2



      

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.