Class: HttpKinesis::Credentials

Inherits:
Object
  • Object
show all
Defined in:
lib/http-kinesis/credentials.rb

Overview

Encapsulates credentials to use with an HttpKinesis::Client

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(credential_file = nil, section = 'default') ⇒ Object

Returns A HttpKinesis::Credentials object.

Parameters:

  • credential_file (String) (defaults to: nil)

    The path to the credentials file. If nil, then credentials will be obtained from the environment variables AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY if set, otherwise from the default credentials file a ~/.aws/credentials.

  • section (String) (defaults to: 'default')

    The section of the credentials file to use.


18
19
20
21
22
23
24
25
26
27
# File 'lib/http-kinesis/credentials.rb', line 18

def initialize(credential_file = nil, section = 'default')
  @section = section
  @access_key = nil
  @secret = nil
  if credential_file.nil?
    load_from_defaults
  else
    load_from_credential_file(credential_file, section)
  end
end

Instance Attribute Details

#access_keyObject (readonly)

Returns the value of attribute access_key


9
10
11
# File 'lib/http-kinesis/credentials.rb', line 9

def access_key
  @access_key
end

#secretObject (readonly)

Returns the value of attribute secret


9
10
11
# File 'lib/http-kinesis/credentials.rb', line 9

def secret
  @secret
end