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:



184
185
186
187
188
189
190
191
192
# File 'lib/bogo/smash.rb', line 184

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