module AWS::DynamoDB::Keys

@private

Public Instance Methods

item_key_hash(item) click to toggle source

@return [Hash] Returns just the hash key element and range key element

# File lib/aws/dynamo_db/keys.rb, line 29
def item_key_hash item
  item.table.assert_schema!
  key = {}
  key[:hash_key_element] = format_attribute_value(item.hash_value)
  key[:range_key_element] = format_attribute_value(item.range_value) if
    item.table.composite_key?
  key
end
item_key_options(item, extra = {}) click to toggle source

@return [Hash] Client options for identifying an item.

# File lib/aws/dynamo_db/keys.rb, line 23
def item_key_options(item, extra = {})
  key = item_key_hash(item)
  extra.merge({ :table_name => item.table.name, :key => key })
end