Class: ActiveID::Type::Base Abstract
- Inherits:
-
ActiveRecord::Type::Value
- Object
- ActiveRecord::Type::Value
- ActiveID::Type::Base
- Defined in:
- lib/active_id/type.rb
Overview
This class is abstract.
Subclasses should define at least instantiate_storage method.
See subclasses.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#storage_type ⇒ Object
readonly
Returns the value of attribute storage_type.
Instance Method Summary collapse
-
#cast_value(value) ⇒ Object
Converts strings into UUIDs on user input assignment, called internally from #cast.
-
#deserialize(value) ⇒ Object
Converts binary values into UUIDs.
-
#initialize ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize ⇒ Base
Returns a new instance of Base.
26 27 28 |
# File 'lib/active_id/type.rb', line 26 def initialize @storage_type = instantiate_storage end |
Instance Attribute Details
#storage_type ⇒ Object (readonly)
Returns the value of attribute storage_type.
21 22 23 |
# File 'lib/active_id/type.rb', line 21 def storage_type @storage_type end |
Instance Method Details
#cast_value(value) ⇒ Object
Converts strings into UUIDs on user input assignment, called internally from #cast.
37 38 39 |
# File 'lib/active_id/type.rb', line 37 def cast_value(value) cast_to_uuid(value) end |
#deserialize(value) ⇒ Object
Converts binary values into UUIDs.
31 32 33 |
# File 'lib/active_id/type.rb', line 31 def deserialize(value) cast_to_uuid(s_deserialize(value)) end |