Class: Bisques::AwsCredentials

Inherits:
Object
  • Object
show all
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.

Examples:


AwsCredentials.default('aws_key', 'aws_secret')

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(aws_key, aws_secret) ⇒ AwsCredentials

Returns a new instance of AwsCredentials.

Parameters:

  • aws_key (String)
  • aws_secret (String)


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_keyString (readonly)

Returns:

  • (String)


11
12
13
# File 'lib/bisques/aws_credentials.rb', line 11

def aws_key
  @aws_key
end

#aws_secretString (readonly)

Returns:

  • (String)


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

Parameters:

  • aws_key (String)
  • aws_secret (String)


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