Class: Array

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

Overview

:nodoc: all

Instance Method Summary collapse

Instance Method Details

#to_h(default = nil) ⇒ Object



41
42
43
# File 'lib/feed_discover.rb', line 41

def to_h(default=nil) 
  Hash[ *inject([]) { |a, value| a.push value, default || yield(value) } ] 
end