Class: Hash

Inherits:
Object
  • Object
show all
Defined in:
lib/randomperson/ext/hash.rb

Instance Method Summary collapse

Instance Method Details

#by_index(n) ⇒ Object



2
3
4
# File 'lib/randomperson/ext/hash.rb', line 2

def by_index( n )
  self.each_with_index { |item, index| break item if index == n }
end