Module: Rooftop::Coercions::ClassMethods

Defined in:
lib/rooftop/coercions.rb

Instance Method Summary collapse

Instance Method Details

#coerce_field(*coercions) ⇒ Object

Parameters:

  • coercion (Hash)

    the coercion to apply - key is the field, value is a lambda



30
31
32
33
34
35
36
# File 'lib/rooftop/coercions.rb', line 30

def coerce_field(*coercions)
  @coercions ||= {}
  coercions.each do |coercions_hash|
    @coercions.merge!(coercions_hash)
  end
  @coercions
end