class Alephant::Support::DynamoDB::Table

Constants

DEFAULT_CONFIG
TIMEOUT

Public Instance Methods

table() click to toggle source
# File lib/alephant/support/dynamodb/table.rb, line 11
def table
  raise NotImplementedError
end
truncate!() click to toggle source
# File lib/alephant/support/dynamodb/table.rb, line 15
def truncate!
  batch_delete table_data
end

Private Instance Methods

batch_delete(rows) click to toggle source
# File lib/alephant/support/dynamodb/table.rb, line 21
def batch_delete(rows)
  rows.each_slice(25) { |arr| table.batch_delete(arr) }
end
construct_attributes_from(item) click to toggle source
# File lib/alephant/support/dynamodb/table.rb, line 32
def construct_attributes_from(item)
  no_range_key? ? item.hash_value : [item.hash_value, item.range_value.to_i]
end
no_range_key?() click to toggle source
# File lib/alephant/support/dynamodb/table.rb, line 36
def no_range_key?
  @range_found ||= table.range_key.nil?
end
table_data() click to toggle source
# File lib/alephant/support/dynamodb/table.rb, line 25
def table_data
  table.load_schema unless table.schema_loaded?
  table.items.collect do |item|
    construct_attributes_from item
  end
end