Module: ActiveModel::Coercions::ClassMethods

Defined in:
lib/active_model/coercions.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#declared_coercionsObject

Returns the value of attribute declared_coercions.



18
19
20
# File 'lib/active_model/coercions.rb', line 18

def declared_coercions
  @declared_coercions
end

Instance Method Details

#attribute(attr, type) ⇒ Object



20
21
22
# File 'lib/active_model/coercions.rb', line 20

def attribute(attr, type)
  @declared_coercions[attr] = Coercer.new(type)
end