Class: IesAuth::Ies

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeIes

Returns a new instance of Ies.



14
15
16
# File 'lib/ies_auth.rb', line 14

def initialize
  @api_endpoint = ENV.fetch('IES_API_URL') { 'https://int-piapi-internal.stg-openclass.com' }
end

Instance Attribute Details

#api_endpointObject (readonly)

Returns the value of attribute api_endpoint.



13
14
15
# File 'lib/ies_auth.rb', line 13

def api_endpoint
  @api_endpoint
end

Instance Method Details

#ies_api_url(str) ⇒ Object



18
19
20
# File 'lib/ies_auth.rb', line 18

def ies_api_url(str)
  [api_endpoint.chomp('/'), *str.split('/')].join('/')
end

#passwordObject



26
27
28
# File 'lib/ies_auth.rb', line 26

def password
  ENV.fetch('IES_API_PASSWORD')
end

#usernameObject



22
23
24
# File 'lib/ies_auth.rb', line 22

def username
  ENV.fetch('IES_API_USER_NAME')
end