Class: SQS::Config
- Inherits:
-
Object
- Object
- SQS::Config
- Defined in:
- lib/sqs/config.rb
Overview
SQS::Config stores your AWS access_key and secret_access_key. These attributes raise exceptions if they are checked but have not been set.
Constant Summary collapse
- @@access_key =
nil
- @@secret_access_key =
nil
Class Method Summary collapse
- .access_key ⇒ Object
-
.parse(yaml_hash) ⇒ Object
Load configuration from a YAML::load-generated hash.
- .secret_access_key ⇒ Object
Class Method Details
.access_key ⇒ Object
15 16 17 18 |
# File 'lib/sqs/config.rb', line 15 def self.access_key raise ArgumentError, "No access key defined!" if @@access_key.nil? return @@access_key end |
.parse(yaml_hash) ⇒ Object
Load configuration from a YAML::load-generated hash
26 27 28 29 |
# File 'lib/sqs/config.rb', line 26 def self.parse yaml_hash self.access_key = yaml_hash['access_key'] unless yaml_hash['access_key'].nil? || yaml_hash['access_key'].empty? self.secret_access_key = yaml_hash['secret_access_key'] unless yaml_hash['secret_access_key'].nil? || yaml_hash['secret_access_key'].empty? end |
.secret_access_key ⇒ Object
20 21 22 23 |
# File 'lib/sqs/config.rb', line 20 def self.secret_access_key raise ArgumentError, "No secret access key defined!" if @@secret_access_key.nil? return @@secret_access_key end |