Class: StoreModel::Types::OneBase
- Defined in:
- lib/store_model/types/one_base.rb
Overview
Implements type for handling an instance of StoreModel::Model
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#cast_value(_value) ⇒ Object
Casts
valuefrom DB or user to StoreModel::Model instance. -
#changed_in_place?(raw_old_value, new_value) ⇒ Boolean
Determines whether the mutable value has been modified since it was read.
Methods inherited from Base
Instance Method Details
#cast_value(_value) ⇒ Object
Casts value from DB or user to StoreModel::Model instance
14 15 16 |
# File 'lib/store_model/types/one_base.rb', line 14 def cast_value(_value) raise NotImplementedError end |
#changed_in_place?(raw_old_value, new_value) ⇒ Boolean
Determines whether the mutable value has been modified since it was read
24 25 26 |
# File 'lib/store_model/types/one_base.rb', line 24 def changed_in_place?(raw_old_value, new_value) cast_value(raw_old_value) != new_value end |