Class: Dynamo::Model::Client
- Inherits:
-
Object
- Object
- Dynamo::Model::Client
- Defined in:
- lib/dynamo/model/client.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
Returns the value of attribute config.
-
#dynamodb ⇒ Object
Returns the value of attribute dynamodb.
Instance Method Summary collapse
-
#initialize ⇒ Client
constructor
A new instance of Client.
- #setup ⇒ Object
Constructor Details
#initialize ⇒ Client
Returns a new instance of Client.
6 7 8 9 10 11 12 13 |
# File 'lib/dynamo/model/client.rb', line 6 def initialize @config = Configuration.configure do |conf| config.access_key_id = ENV["aws_access_key_id"] config.secret_access_key = ENV["aws_secret_access_key"] config.region = ENV["aws_region"] end setup end |
Instance Attribute Details
#config ⇒ Object
Returns the value of attribute config.
4 5 6 |
# File 'lib/dynamo/model/client.rb', line 4 def config @config end |
#dynamodb ⇒ Object
Returns the value of attribute dynamodb.
4 5 6 |
# File 'lib/dynamo/model/client.rb', line 4 def dynamodb @dynamodb end |
Instance Method Details
#setup ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/dynamo/model/client.rb', line 15 def setup @dynamodb = Aws::DynamoDB::Client.new( region: @config.region, access_key_id: @config.access_key_id, secret_access_key: @configsecret_access_key ) end |