Class: ActiveFields::Casters::BaseCaster
- Inherits:
-
Object
- Object
- ActiveFields::Casters::BaseCaster
- Defined in:
- lib/active_fields/casters/base_caster.rb
Overview
Typecasts the active_value value
Direct Known Subclasses
BooleanCaster, DateCaster, DateTimeCaster, DecimalCaster, EnumCaster, IntegerCaster, TextCaster
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
-
#deserialize(value) ⇒ Object
From raw AR attribute value.
-
#initialize(**options) ⇒ BaseCaster
constructor
A new instance of BaseCaster.
-
#serialize(value) ⇒ Object
To raw AR attribute value.
Constructor Details
#initialize(**options) ⇒ BaseCaster
Returns a new instance of BaseCaster.
9 10 11 |
# File 'lib/active_fields/casters/base_caster.rb', line 9 def initialize(**) @options = end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
7 8 9 |
# File 'lib/active_fields/casters/base_caster.rb', line 7 def @options end |
Instance Method Details
#deserialize(value) ⇒ Object
From raw AR attribute value
19 20 21 |
# File 'lib/active_fields/casters/base_caster.rb', line 19 def deserialize(value) raise NotImplementedError end |
#serialize(value) ⇒ Object
To raw AR attribute value
14 15 16 |
# File 'lib/active_fields/casters/base_caster.rb', line 14 def serialize(value) raise NotImplementedError end |