Class: IesAuth::Ies
- Inherits:
-
Object
- Object
- IesAuth::Ies
- Defined in:
- lib/ies_auth.rb
Instance Attribute Summary collapse
-
#api_endpoint ⇒ Object
readonly
Returns the value of attribute api_endpoint.
Instance Method Summary collapse
- #ies_api_url(str) ⇒ Object
-
#initialize ⇒ Ies
constructor
A new instance of Ies.
- #password ⇒ Object
- #username ⇒ Object
Constructor Details
#initialize ⇒ Ies
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_endpoint ⇒ Object (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 |
#password ⇒ Object
26 27 28 |
# File 'lib/ies_auth.rb', line 26 def password ENV.fetch('IES_API_PASSWORD') end |
#username ⇒ Object
22 23 24 |
# File 'lib/ies_auth.rb', line 22 def username ENV.fetch('IES_API_USER_NAME') end |