module Toy::Extensions::Set

Public Instance Methods

from_store(value, *) click to toggle source
# File lib/toy/dynamo/extensions/set.rb, line 12
def from_store(value, *)
  value.nil? ? store_default : Marshal.load(value)
end
store_default() click to toggle source
# File lib/toy/dynamo/extensions/set.rb, line 4
def store_default
  [].to_set
end
to_store(value, *) click to toggle source
# File lib/toy/dynamo/extensions/set.rb, line 8
def to_store(value, *)
  AWS::DynamoDB::Binary.new(Marshal.dump(value))
end