Class: RdyItem

Inherits:
Rdy
  • Object
show all
Defined in:
lib/rdy.rb

Instance Attribute Summary

Attributes inherited from Rdy

#check_table_status, #hash_key_conditional_check

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Rdy

#all, #attributes, #build, #count, #destroy, dynamo_db, find, #find, generate_key, #hash_key, #hash_value, #is_new?, #query, #query_by_range_value, #range_key, #range_value, #save, #scan, #table, #table=, #table_exists?

Constructor Details

#initialize(hash_key, range_key = nil, table = nil) ⇒ RdyItem

Returns a new instance of RdyItem.



151
152
153
# File 'lib/rdy.rb', line 151

def initialize(hash_key, range_key = nil, table = nil)
  super(table ? table.to_s : "#{self.class.name.downcase}s", hash_key, range_key)
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Rdy

Class Method Details

.create_table(read_capacity_units, write_capacity_units, hash_key, range_key = nil) ⇒ Object



155
156
157
158
# File 'lib/rdy.rb', line 155

def self.create_table(read_capacity_units, write_capacity_units, hash_key, range_key = nil)
  dynamo_db.tables.create(self.table, read_capacity_units, write_capacity_units,
    :hash_key => hash_key, :range_key => range_key)
end