Class: Array

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

Instance Method Summary collapse

Instance Method Details

#to_smash(*args) ⇒ Array

Iterates searching for Hash types to auto convert

Returns:



209
210
211
212
213
214
215
216
217
# File 'lib/bogo/smash.rb', line 209

def to_smash(*args)
  self.map do |item|
    if(item.respond_to?(:to_smash))
      item.to_smash(*args)
    else
      args.include?(:freeze) ? item.freeze : item
    end
  end
end