Class: SacsRuby::Credentials

Inherits:
Object
  • Object
show all
Defined in:
lib/sacs_ruby/credentials.rb

Overview

Class for constructing base64 encoded credentials

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeCredentials

Returns a new instance of Credentials.



8
9
10
11
12
13
14
15
# File 'lib/sacs_ruby/credentials.rb', line 8

def initialize
  fail ConfigurationError if SacsRuby.configuration.nil?
  @user_id = SacsRuby.configuration.user_id
  @group = SacsRuby.configuration.group
  @domain = SacsRuby.configuration.domain
  @client_secret = SacsRuby.configuration.client_secret
  @encoded = encode("#{encoded_client_id}:#{encoded_client_secret}")
end

Instance Attribute Details

#client_secretObject (readonly)

Returns the value of attribute client_secret.



6
7
8
# File 'lib/sacs_ruby/credentials.rb', line 6

def client_secret
  @client_secret
end

#domainObject (readonly)

Returns the value of attribute domain.



6
7
8
# File 'lib/sacs_ruby/credentials.rb', line 6

def domain
  @domain
end

#encodedObject (readonly)

Returns the value of attribute encoded.



6
7
8
# File 'lib/sacs_ruby/credentials.rb', line 6

def encoded
  @encoded
end

#groupObject (readonly)

Returns the value of attribute group.



6
7
8
# File 'lib/sacs_ruby/credentials.rb', line 6

def group
  @group
end

#user_idObject (readonly)

Returns the value of attribute user_id.



6
7
8
# File 'lib/sacs_ruby/credentials.rb', line 6

def user_id
  @user_id
end