Class: Aws::DynamoDB::AttributeValue::Marshaler 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.



25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/aws-sdk-core/dynamodb/attribute_value.rb', line 25

def format(obj)
  case obj
  when String then { s: obj }
  when Numeric then { n: obj.to_s }
  when StringIO, IO then { b: obj.read }
  when Set then format_set(obj)
  else
    msg = "unsupported type, expected Set, String, Numeric, or "
    msg << "IO object, got #{obj.class.name}"
    raise ArgumentError, msg
  end
end