Class: Bisques::AwsCredentials
- Inherits:
-
Object
- Object
- Bisques::AwsCredentials
- Defined in:
- lib/bisques/aws_credentials.rb
Overview
Represents an AWS key/secret combination. Provides a convenient class method for setting defaults that can be used by all objects later on.
Instance Attribute Summary collapse
- #aws_key ⇒ String readonly
- #aws_secret ⇒ String readonly
Class Method Summary collapse
-
.default(*args) ⇒ Object
Set or retrieve the default credentials.
Instance Method Summary collapse
-
#initialize(aws_key, aws_secret) ⇒ AwsCredentials
constructor
A new instance of AwsCredentials.
Constructor Details
#initialize(aws_key, aws_secret) ⇒ AwsCredentials
Returns a new instance of AwsCredentials.
15 16 17 |
# File 'lib/bisques/aws_credentials.rb', line 15 def initialize(aws_key, aws_secret) @aws_key, @aws_secret = aws_key, aws_secret end |
Instance Attribute Details
#aws_key ⇒ String (readonly)
11 12 13 |
# File 'lib/bisques/aws_credentials.rb', line 11 def aws_key @aws_key end |
#aws_secret ⇒ String (readonly)
11 12 13 |
# File 'lib/bisques/aws_credentials.rb', line 11 def aws_secret @aws_secret end |
Class Method Details
.default(*args) ⇒ Object
Set or retrieve the default credentials
22 23 24 25 26 27 28 29 30 |
# File 'lib/bisques/aws_credentials.rb', line 22 def default(*args) if args.size == 2 @default = AwsCredentials.new(*args) elsif args.empty? @default else raise ArgumentError, "default takes 0 or 2 arguments" end end |