class TinyDyno::Adapter::AttributeValue
Public Class Methods
new()
click to toggle source
utilize the same type coercions as in the ruby aws-sdk ( github.com/aws/aws-sdk-ruby/blob/master/aws-sdk-core/lib/aws-sdk-core/dynamodb/attribute_value.rb ) however in a more deterministic fashion the type conversion employed by the simple attribute feature is purely based on the value field tiny_dyno enforces coercion into the designated target data type or raises an error on mismatch
# File lib/tiny_dyno/adapter/attributes.rb, line 17 def initialize @marshaler = Marshaler.new @unmarshaler = Unmarshaler.new end
Public Instance Methods
marshal(type:, value:)
click to toggle source
# File lib/tiny_dyno/adapter/attributes.rb, line 22 def marshal(type:, value:) @marshaler.format(type: type, obj: value) end
unmarshal(value)
click to toggle source
# File lib/tiny_dyno/adapter/attributes.rb, line 26 def unmarshal(value) @unmarshaler.format(value) end