Class: ActiveFields::Casters::BaseCaster

Inherits:
Object
  • Object
show all
Defined in:
lib/active_fields/casters/base_caster.rb

Overview

Typecasts the active_value value

Instance Attribute Summary collapse

Instance Method Summary collapse

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)
  @options = options
end

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



7
8
9
# File 'lib/active_fields/casters/base_caster.rb', line 7

def options
  @options
end

Instance Method Details

#deserialize(value) ⇒ Object

From raw AR attribute value

Raises:

  • (NotImplementedError)


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

Raises:

  • (NotImplementedError)


14
15
16
# File 'lib/active_fields/casters/base_caster.rb', line 14

def serialize(value)
  raise NotImplementedError
end