Class: SnsSender::Configuration
- Inherits:
-
Object
- Object
- SnsSender::Configuration
- Defined in:
- lib/sns_sender/configuration.rb
Instance Attribute Summary collapse
-
#aws_access_key_id ⇒ Object
Returns the value of attribute aws_access_key_id.
-
#aws_region ⇒ Object
Returns the value of attribute aws_region.
-
#aws_secret_access_key ⇒ Object
Returns the value of attribute aws_secret_access_key.
-
#default_topic_arn ⇒ Object
Returns the value of attribute default_topic_arn.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #validate! ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
10 11 12 13 14 |
# File 'lib/sns_sender/configuration.rb', line 10 def initialize @aws_region = ENV["AWS_REGION"] @aws_access_key_id = ENV["AWS_ACCESS_KEY_ID"] @aws_secret_access_key = ENV["AWS_SECRET_ACCESS_KEY"] end |
Instance Attribute Details
#aws_access_key_id ⇒ Object
Returns the value of attribute aws_access_key_id.
5 6 7 |
# File 'lib/sns_sender/configuration.rb', line 5 def aws_access_key_id @aws_access_key_id end |
#aws_region ⇒ Object
Returns the value of attribute aws_region.
5 6 7 |
# File 'lib/sns_sender/configuration.rb', line 5 def aws_region @aws_region end |
#aws_secret_access_key ⇒ Object
Returns the value of attribute aws_secret_access_key.
5 6 7 |
# File 'lib/sns_sender/configuration.rb', line 5 def aws_secret_access_key @aws_secret_access_key end |
#default_topic_arn ⇒ Object
Returns the value of attribute default_topic_arn.
5 6 7 |
# File 'lib/sns_sender/configuration.rb', line 5 def default_topic_arn @default_topic_arn end |
Instance Method Details
#validate! ⇒ Object
16 17 18 19 20 21 22 23 24 25 |
# File 'lib/sns_sender/configuration.rb', line 16 def validate! missing_configs = [] missing_configs << "aws_region" unless aws_region missing_configs << "aws_access_key_id" unless aws_access_key_id missing_configs << "aws_secret_access_key" unless aws_secret_access_key return true if missing_configs.empty? raise ConfigurationError, "Missing required AWS configurations: #{missing_configs.join(", ")}" end |