Class: Array

Inherits:
Object
  • Object
show all
Defined in:
lib/prefered/preference.rb

Instance Method Summary collapse

Instance Method Details

#to_h(&block) ⇒ Object



2
3
4
5
6
# File 'lib/prefered/preference.rb', line 2

def to_h(&block)
  Hash[*self.collect { |v|
    [v, block.call(v)]
  }.flatten]
end