Module: Minidynamo::Model::DefinitionHelpers
- Included in:
- Minidynamo::Model
- Defined in:
- lib/minidynamo/model/definition_helpers.rb
Instance Attribute Summary collapse
Instance Method Summary collapse
-
#field(key, type, options = {}) ⇒ Object
TABLE STRUCTURE HELPERS.
- #initial_througput(options = {}) ⇒ Object
-
#table(options = {}) ⇒ Object
attr_accessor :range_key.
Instance Attribute Details
#read_capacity ⇒ Object
30 31 32 |
# File 'lib/minidynamo/model/definition_helpers.rb', line 30 def read_capacity @read_capacity || 10 end |
#write_capacity ⇒ Object
34 35 36 |
# File 'lib/minidynamo/model/definition_helpers.rb', line 34 def write_capacity @write_capacity || 10 end |
Instance Method Details
#field(key, type, options = {}) ⇒ Object
TABLE STRUCTURE HELPERS
20 21 22 23 |
# File 'lib/minidynamo/model/definition_helpers.rb', line 20 def field key, type, = {} method_name = "#{type.to_s}_attr".to_sym send method_name, key, end |
#initial_througput(options = {}) ⇒ Object
25 26 27 28 |
# File 'lib/minidynamo/model/definition_helpers.rb', line 25 def initial_througput = {} self.read_capacity = [:read_capacity] self.write_capacity = [:write_capacity] end |
#table(options = {}) ⇒ Object
attr_accessor :range_key
10 11 12 13 14 |
# File 'lib/minidynamo/model/definition_helpers.rb', line 10 def table = {} set_shard_name [:name] self.hash_key = [:hash_key] unless [:hash_key].nil? self.range_key = [:range_key] unless [:range_key].nil? end |