Class: Eventosaurus::Configuration
- Inherits:
-
Object
- Object
- Eventosaurus::Configuration
- Defined in:
- lib/eventosaurus/configuration.rb
Instance Attribute Summary collapse
-
#aws_access_key_id ⇒ Object
Returns the value of attribute aws_access_key_id.
-
#aws_endpoint ⇒ Object
Returns the value of attribute aws_endpoint.
-
#aws_region ⇒ Object
Returns the value of attribute aws_region.
-
#aws_secret_access_key ⇒ Object
Returns the value of attribute aws_secret_access_key.
-
#dynamodb_client ⇒ Object
Returns the value of attribute dynamodb_client.
-
#dynamodb_table_namespace ⇒ Object
Returns the value of attribute dynamodb_table_namespace.
-
#dynamodb_warn_on_scan ⇒ Object
Returns the value of attribute dynamodb_warn_on_scan.
-
#environment_prefix ⇒ Object
Returns the value of attribute environment_prefix.
-
#logger ⇒ Object
Returns the value of attribute logger.
-
#persistor ⇒ Object
Returns the value of attribute persistor.
Instance Method Summary collapse
- #aws_credentials ⇒ Object
- #configure_aws ⇒ Object
- #configure_dynamodb ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #use_sidekiq ⇒ Object
- #use_synchronous ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
39 40 41 |
# File 'lib/eventosaurus/configuration.rb', line 39 def initialize @logger = Logger.new(STDOUT) end |
Instance Attribute Details
#aws_access_key_id ⇒ Object
Returns the value of attribute aws_access_key_id.
28 29 30 |
# File 'lib/eventosaurus/configuration.rb', line 28 def aws_access_key_id @aws_access_key_id end |
#aws_endpoint ⇒ Object
Returns the value of attribute aws_endpoint.
29 30 31 |
# File 'lib/eventosaurus/configuration.rb', line 29 def aws_endpoint @aws_endpoint end |
#aws_region ⇒ Object
Returns the value of attribute aws_region.
31 32 33 |
# File 'lib/eventosaurus/configuration.rb', line 31 def aws_region @aws_region end |
#aws_secret_access_key ⇒ Object
Returns the value of attribute aws_secret_access_key.
30 31 32 |
# File 'lib/eventosaurus/configuration.rb', line 30 def aws_secret_access_key @aws_secret_access_key end |
#dynamodb_client ⇒ Object
Returns the value of attribute dynamodb_client.
33 34 35 |
# File 'lib/eventosaurus/configuration.rb', line 33 def dynamodb_client @dynamodb_client end |
#dynamodb_table_namespace ⇒ Object
Returns the value of attribute dynamodb_table_namespace.
34 35 36 |
# File 'lib/eventosaurus/configuration.rb', line 34 def dynamodb_table_namespace @dynamodb_table_namespace end |
#dynamodb_warn_on_scan ⇒ Object
Returns the value of attribute dynamodb_warn_on_scan.
35 36 37 |
# File 'lib/eventosaurus/configuration.rb', line 35 def dynamodb_warn_on_scan @dynamodb_warn_on_scan end |
#environment_prefix ⇒ Object
Returns the value of attribute environment_prefix.
32 33 34 |
# File 'lib/eventosaurus/configuration.rb', line 32 def environment_prefix @environment_prefix end |
#logger ⇒ Object
Returns the value of attribute logger.
36 37 38 |
# File 'lib/eventosaurus/configuration.rb', line 36 def logger @logger end |
#persistor ⇒ Object
Returns the value of attribute persistor.
37 38 39 |
# File 'lib/eventosaurus/configuration.rb', line 37 def persistor @persistor end |
Instance Method Details
#aws_credentials ⇒ Object
59 60 61 62 63 64 65 |
# File 'lib/eventosaurus/configuration.rb', line 59 def aws_credentials self.aws_region ||= 'us-east-2' self.aws_access_key_id ||= 'unset' self.aws_secret_access_key ||= 'unset' @aws_credientials ||= Aws::Credentials.new(aws_access_key_id, aws_secret_access_key) end |
#configure_aws ⇒ Object
55 56 57 |
# File 'lib/eventosaurus/configuration.rb', line 55 def configure_aws Aws.config.update(region: aws_region, credentials: aws_credentials) end |
#configure_dynamodb ⇒ Object
67 68 69 70 71 72 73 74 75 76 77 78 |
# File 'lib/eventosaurus/configuration.rb', line 67 def configure_dynamodb self.environment_prefix ||= 'unset' args = { region: aws_region, credentials: aws_credentials } args[:endpoint] = aws_endpoint if aws_endpoint.present? self.dynamodb_client = Aws::DynamoDB::Client.new(args) end |
#use_sidekiq ⇒ Object
49 50 51 52 53 |
# File 'lib/eventosaurus/configuration.rb', line 49 def use_sidekiq require 'eventosaurus/persistors/sidekiq' @persistor = Eventosaurus::Persistors::Sidekiq end |
#use_synchronous ⇒ Object
43 44 45 46 47 |
# File 'lib/eventosaurus/configuration.rb', line 43 def use_synchronous require 'eventosaurus/persistors/synchronous' @persistor = Eventosaurus::Persistors::Synchronous end |