class ROM::DynamoDB::Relation

Public Instance Methods

count() click to toggle source

@return [Fixnum] current total item count for the associated DynamoDB table

# File lib/rom/dynamodb/relation.rb, line 67
def count
  dataset.information.item_count
end
fetch(key, id) click to toggle source

Retrieve a single record, providing a hash key name and the ID to fetch.

@note This is a very simple helper allowing you to easily retrieve

singular records using a hash key lookup.

@param key [Symbol] the hash key name to fetch on @param id [String, Fixnum] an accepted data format for DynamoDB to lookup on @return [Hash] a single object retrieved from DynamoDB

# File lib/rom/dynamodb/relation.rb, line 56
def fetch(key, id)
  retrieve(key, id).one!
end
info() click to toggle source

@see docs.aws.amazon.com/sdkforruby/api/Aws/DynamoDB/Client.html#describe_table-instance_method @return [Hash] AWS SDK payload of table information

# File lib/rom/dynamodb/relation.rb, line 62
def info
  dataset.information
end
status() click to toggle source

@return [Symbol] current status of the DynamoDB table

# File lib/rom/dynamodb/relation.rb, line 72
def status
  dataset.information.table_status.downcase.to_sym
rescue
  :unknown
end