module Toy::Extensions::Array

Public Instance Methods

from_store(value, *) click to toggle source
# File lib/toy/dynamo/extensions/array.rb, line 9
def from_store(value, *)
  value.nil? ? store_default : (value.class.is_a?(Array) ? value : Marshal.load(value))
end
to_store(value, *) click to toggle source
# File lib/toy/dynamo/extensions/array.rb, line 4
def to_store(value, *)
  value = value.respond_to?(:lines) ? value.lines : value
  AWS::DynamoDB::Binary.new(Marshal.dump(value.to_a))
end