Module: ClassKit::CustomType
- Defined in:
- lib/class_kit/custom_type.rb
Class Method Summary collapse
- .included(base) ⇒ Object
-
.parse_assign(_value) ⇒ Object
This method must return the parsed value when the class’ attribute is assigned a value.
-
.parse_from_hash(_value) ⇒ Object
This method must return the parsed value when
from_hash
is called.
Instance Method Summary collapse
-
#to_hash_value ⇒ Object
This method must return the value that will be serialised for the attribute.
Class Method Details
.included(base) ⇒ Object
3 4 5 |
# File 'lib/class_kit/custom_type.rb', line 3 def self.included(base) base.extend(CustomType) end |
.parse_assign(_value) ⇒ Object
This method must return the parsed value when the class’ attribute is assigned a value
13 14 15 |
# File 'lib/class_kit/custom_type.rb', line 13 def self.parse_assign(_value) raise NotImplementedError end |
.parse_from_hash(_value) ⇒ Object
This method must return the parsed value when from_hash
is called
8 9 10 |
# File 'lib/class_kit/custom_type.rb', line 8 def self.parse_from_hash(_value) raise NotImplementedError end |
Instance Method Details
#to_hash_value ⇒ Object
This method must return the value that will be serialised for the attribute
18 19 20 |
# File 'lib/class_kit/custom_type.rb', line 18 def to_hash_value raise NotImplementedError end |