Method: Hashematics::Dictionary#add
- Defined in:
- lib/hashematics/dictionary.rb
#add(enumerable) ⇒ Object
31 32 33 34 35 36 37 38 39 40 |
# File 'lib/hashematics/dictionary.rb', line 31 def add(enumerable) raise ArgumentError, 'block must be given for key resolution' unless block_given? enumerable.each do |entry| key = yield entry set(key, entry) end self end |