Class: ActiveRecord::Coders::NestedHstore
- Inherits:
-
Hstore
- Object
- Hstore
- ActiveRecord::Coders::NestedHstore
- Defined in:
- lib/active_record/coders/nested_hstore.rb,
lib/active_record/coders/nested_hstore.rb
Class Method Summary collapse
Instance Method Summary collapse
- #dump(value) ⇒ Object
-
#initialize ⇒ NestedHstore
constructor
A new instance of NestedHstore.
- #load(hash) ⇒ Object
Constructor Details
#initialize ⇒ NestedHstore
Returns a new instance of NestedHstore.
7 8 9 10 |
# File 'lib/active_record/coders/nested_hstore.rb', line 7 def initialize(default=nil) super(default) @nested_serializer = ::NestedHstore::Serializer.new end |
Class Method Details
.dump(hstore) ⇒ Object
28 29 30 |
# File 'lib/active_record/coders/nested_hstore.rb', line 28 def self.dump(hstore) new.dump(hstore) end |
.load(hstore) ⇒ Object
24 25 26 |
# File 'lib/active_record/coders/nested_hstore.rb', line 24 def self.load(hstore) new.load(hstore) end |
Instance Method Details
#dump(value) ⇒ Object
40 41 42 |
# File 'lib/active_record/coders/nested_hstore.rb', line 40 def dump(value) @nested_serializer.serialize(value) end |
#load(hash) ⇒ Object
36 37 38 |
# File 'lib/active_record/coders/nested_hstore.rb', line 36 def load(hash) @nested_serializer.deserialize(hash) end |