Class: Array
Instance Method Summary collapse
Instance Method Details
#binary ⇒ Object
9 10 11 |
# File 'lib/commercebank/monkey.rb', line 9 def binary map {|e| yield(e) ? [e, nil] : [nil, e]}.transpose.map {|a| a.compact} end |
#paramify ⇒ Object
13 14 15 16 17 18 19 20 |
# File 'lib/commercebank/monkey.rb', line 13 def paramify hash = Hash.new hash.merge! pop if last.kind_of? Hash each {|e| hash[e] = true} hash end |