module Minidynamo::Model::DefinitionHelpers

Attributes

read_capacity[W]

For all the fields with defaults

write_capacity[W]

For all the fields with defaults

Public Instance Methods

field(key, type, options = {}) click to toggle source

TABLE STRUCTURE HELPERS

# File lib/minidynamo/model/definition_helpers.rb, line 20
def field key, type, options = {}
        method_name = "#{type.to_s}_attr".to_sym
        send method_name, key, options
end
initial_throughput(options = {}) click to toggle source
# File lib/minidynamo/model/definition_helpers.rb, line 25
def initial_throughput options = {}
        self.read_capacity = options[:read_capacity]
        self.write_capacity = options[:write_capacity]
end
read_capacity() click to toggle source
# File lib/minidynamo/model/definition_helpers.rb, line 30
def read_capacity
        @read_capacity || 10
end
table(options = {}) click to toggle source

attr_accessor :range_key

# File lib/minidynamo/model/definition_helpers.rb, line 10
def table options = {}
        set_shard_name options[:name]
        self.hash_key = options[:hash_key] unless options[:hash_key].nil?
        self.range_key = options[:range_key] unless options[:range_key].nil?
end
write_capacity() click to toggle source
# File lib/minidynamo/model/definition_helpers.rb, line 34
def write_capacity
        @write_capacity || 10
end