Class: Aws::DynamoDB::AttributeValue::Unmarshaler Private

Inherits:
Object
  • Object
show all
Defined in:
lib/aws-sdk-core/dynamodb/attribute_value.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Method Summary collapse

Instance Method Details

#format(obj) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



55
56
57
58
59
60
61
62
63
64
65
66
67
# File 'lib/aws-sdk-core/dynamodb/attribute_value.rb', line 55

def format(obj)
  type, value = extract_type_and_value(obj)
  case type
  when :s then value
  when :n then BigDecimal.new(value)
  when :b then StringIO.new(value)
  when :ss then Set.new(value)
  when :ns then Set.new(value.map { |n| BigDecimal.new(n) })
  when :bs then Set.new(value.map { |b| StringIO.new(b) })
  else
    raise ArgumentError, "unhandled type #{type.inspect}"
  end
end