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



25
26
27
28
29
30
31
# File 'lib/rooftop/coercions.rb', line 25

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