Module: Dynamini::ClientInterface
- Included in:
- Base
- Defined in:
- lib/dynamini/client_interface.rb
Defined Under Namespace
Modules: ClassMethods
Class Method Summary collapse
Instance Method Summary collapse
- #delete_from_dynamo ⇒ Object
- #increment_to_dynamo(attributes, opts = {}) ⇒ Object
- #save_to_dynamo ⇒ Object
- #touch_to_dynamo ⇒ Object
Class Method Details
.included(base) ⇒ Object
57 58 59 |
# File 'lib/dynamini/client_interface.rb', line 57 def self.included(base) base.extend ClassMethods end |
Instance Method Details
#delete_from_dynamo ⇒ Object
45 46 47 |
# File 'lib/dynamini/client_interface.rb', line 45 def delete_from_dynamo self.class.client.delete_item(table_name: self.class.table_name, key: key) end |
#increment_to_dynamo(attributes, opts = {}) ⇒ Object
49 50 51 52 53 54 55 |
# File 'lib/dynamini/client_interface.rb', line 49 def increment_to_dynamo(attributes, opts = {}) self.class.client.update_item( table_name: self.class.table_name, key: key, attribute_updates: increment_updates(attributes, opts) ) end |
#save_to_dynamo ⇒ Object
24 25 26 27 28 29 30 |
# File 'lib/dynamini/client_interface.rb', line 24 def save_to_dynamo self.class.client.update_item( table_name: self.class.table_name, key: key, attribute_updates: attribute_updates ) end |
#touch_to_dynamo ⇒ Object
32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/dynamini/client_interface.rb', line 32 def touch_to_dynamo self.class.client.update_item( table_name: self.class.table_name, key: key, attribute_updates: { updated_at: { value: Time.now.to_f, action: 'PUT' } } ) end |