Module: Aws::Record::ClientConfiguration
- Included in:
- Batch, Transactions
- Defined in:
- lib/aws-record/record/client_configuration.rb
Instance Method Summary collapse
-
#configure_client(opts = {}) ⇒ Object
Configures the Amazon DynamoDB client used by this class and all instances of this class.
-
#dynamodb_client ⇒ Aws::DynamoDB::Client
Gets the Client instance that Transactions use.
Instance Method Details
#configure_client(opts = {}) ⇒ Object
Configures the Amazon DynamoDB client used by this class and all instances of this class.
Please note that this method is also called internally when you first attempt to perform an operation against the remote end, if you have not already configured a client. As such, please read and understand the documentation in the AWS SDK for Ruby around configuration to ensure you understand how default configuration behavior works. When in doubt, call this method to ensure your client is configured the way you want it to be configured.
Note: #dynamodb_client is inherited from a parent model when configure_client
is explicitly specified in the parent.
27 28 29 30 31 32 33 34 35 36 |
# File 'lib/aws-record/record/client_configuration.rb', line 27 def configure_client(opts = {}) # rubocop:disable Style/RedundantSelf @dynamodb_client = if self.class != Module && Aws::Record.extends_record?(self) && opts.empty? && self.superclass.instance_variable_get('@dynamodb_client') self.superclass.instance_variable_get('@dynamodb_client') else _build_client(opts) end # rubocop:enable Style/RedundantSelf end |
#dynamodb_client ⇒ Aws::DynamoDB::Client
Gets the Client instance that Transactions use. When called for the first time, if #configure_client has not yet been called, will configure a new client for you with default parameters.
Note: dynamodb_client
is inherited from a parent model when #configure_client is explicitly specified in the parent.
48 49 50 |
# File 'lib/aws-record/record/client_configuration.rb', line 48 def dynamodb_client @dynamodb_client ||= configure_client end |