Class: Neuromancer::Indexer::Configuration
- Inherits:
-
Object
- Object
- Neuromancer::Indexer::Configuration
- Defined in:
- lib/neuromancer/indexer/configuration.rb
Instance Attribute Summary collapse
-
#access_key_id ⇒ Object
Returns the value of attribute access_key_id.
-
#region ⇒ Object
Returns the value of attribute region.
-
#secret_access_key ⇒ Object
Returns the value of attribute secret_access_key.
-
#sqs_url ⇒ Object
Returns the value of attribute sqs_url.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #validate! ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
12 13 14 |
# File 'lib/neuromancer/indexer/configuration.rb', line 12 def initialize @region = 'eu-central-1' end |
Instance Attribute Details
#access_key_id ⇒ Object
Returns the value of attribute access_key_id.
10 11 12 |
# File 'lib/neuromancer/indexer/configuration.rb', line 10 def access_key_id @access_key_id end |
#region ⇒ Object
Returns the value of attribute region.
8 9 10 |
# File 'lib/neuromancer/indexer/configuration.rb', line 8 def region @region end |
#secret_access_key ⇒ Object
Returns the value of attribute secret_access_key.
10 11 12 |
# File 'lib/neuromancer/indexer/configuration.rb', line 10 def secret_access_key @secret_access_key end |
#sqs_url ⇒ Object
Returns the value of attribute sqs_url.
9 10 11 |
# File 'lib/neuromancer/indexer/configuration.rb', line 9 def sqs_url @sqs_url end |
Instance Method Details
#validate! ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/neuromancer/indexer/configuration.rb', line 16 def validate! raise ConfigurationError, '\'region\' cannot be empty' if region.to_s.empty? raise ConfigurationError, '\'sqs_url\' cannot be empty' if sqs_url.to_s.empty? invalid_protocol = '\'sqs_url\' must be a HTTPS url' begin raise ConfigurationError, invalid_protocol if URI(sqs_url).scheme != 'https' rescue StandardError raise ConfigurationError, invalid_protocol end end |