Module: Toy::Extensions::Set
- Defined in:
- lib/toy/dynamo/extensions/set.rb
Instance Method Summary collapse
Instance Method Details
#from_store(value) ⇒ Object
12 13 14 |
# File 'lib/toy/dynamo/extensions/set.rb', line 12 def from_store(value, *) value.nil? ? store_default : Marshal.load(value) end |
#store_default ⇒ Object
4 5 6 |
# File 'lib/toy/dynamo/extensions/set.rb', line 4 def store_default [].to_set end |
#to_store(value) ⇒ Object
8 9 10 |
# File 'lib/toy/dynamo/extensions/set.rb', line 8 def to_store(value, *) AWS::DynamoDB::Binary.new(Marshal.dump(value)) end |