Class: HecksAdapters::DynamoDB::Repository
- Inherits:
-
Object
- Object
- HecksAdapters::DynamoDB::Repository
- Defined in:
- lib/repository.rb
Overview
Use the Aws::DynamoDB::Client to persist your domain resources
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
Instance Method Summary collapse
- #create(args) ⇒ Object
- #delete(id) ⇒ Object
-
#initialize(head) ⇒ Repository
constructor
A new instance of Repository.
- #read(id) ⇒ Object
- #update(id, attributes) ⇒ Object
Constructor Details
#initialize(head) ⇒ Repository
Returns a new instance of Repository.
12 13 14 15 |
# File 'lib/repository.rb', line 12 def initialize(head) @head = head @client = Aws::DynamoDB::Client.new(region: 'us-east-1') end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
10 11 12 |
# File 'lib/repository.rb', line 10 def id @id end |
Instance Method Details
#create(args) ⇒ Object
17 18 19 |
# File 'lib/repository.rb', line 17 def create(args) Commands::Create.new(args, head, client).call end |
#delete(id) ⇒ Object
21 22 23 |
# File 'lib/repository.rb', line 21 def delete(id) Commands::Delete.new({id: id}, head, client).call end |