Class: Conversant::V3::Base
- Inherits:
-
Object
- Object
- Conversant::V3::Base
- Includes:
- HttpClient
- Defined in:
- sig/conversant/v3.rbs,
lib/conversant/v3/base.rb
Overview
Base class for all V3 services
Direct Known Subclasses
Services::CDN, Services::LMS, Services::OSS, Services::Portal, Services::VMS
Constant Summary
Constants included from HttpClient
HttpClient::PORTAL_SESSION_REDIS_KEY, HttpClient::SSO_GW_SESSION2_REDIS_KEY
Instance Attribute Summary collapse
-
#customer_id ⇒ Integer
readonly
Returns the value of attribute customer_id.
-
#type ⇒ Integer
readonly
Returns the value of attribute type.
Instance Method Summary collapse
- #configuration ⇒ Conversant::Configuration
- #identifier ⇒ String
-
#initialize(customer_id, type = 2) ⇒ Base
constructor
A new instance of Base.
- #logger ⇒ Object
- #portal_endpoint ⇒ String
- #redis ⇒ Object
- #sso_endpoint ⇒ String
- #validate_configuration! ⇒ void
Methods included from HttpClient
#add_cookies_to_headers, #authenticate, #cookie_jar, #cookie_jar=, #debug_log, #extract_form_action, #http_get, #http_post, #login_url, #parse_cookie_to_jar, #request, #sso_login, #update_cookie_jar
Constructor Details
#initialize(customer_id, type = 2) ⇒ Base
Returns a new instance of Base.
10 11 12 13 14 |
# File 'lib/conversant/v3/base.rb', line 10 def initialize(customer_id, type = 2) @customer_id = customer_id @type = type validate_configuration! end |
Instance Attribute Details
#customer_id ⇒ Integer (readonly)
Returns the value of attribute customer_id.
8 9 10 |
# File 'lib/conversant/v3/base.rb', line 8 def customer_id @customer_id end |
#type ⇒ Integer (readonly)
Returns the value of attribute type.
8 9 10 |
# File 'lib/conversant/v3/base.rb', line 8 def type @type end |
Instance Method Details
#configuration ⇒ Conversant::Configuration
22 23 24 |
# File 'lib/conversant/v3/base.rb', line 22 def configuration Conversant.configuration end |
#identifier ⇒ String
38 39 40 |
# File 'lib/conversant/v3/base.rb', line 38 def identifier @identifier ||= self.class.name.split('::').map(&:upcase).join('-') end |
#logger ⇒ Object
42 43 44 |
# File 'lib/conversant/v3/base.rb', line 42 def logger configuration.logger end |
#portal_endpoint ⇒ String
30 31 32 |
# File 'lib/conversant/v3/base.rb', line 30 def portal_endpoint configuration.portal_endpoint end |
#redis ⇒ Object
26 27 28 |
# File 'lib/conversant/v3/base.rb', line 26 def redis configuration.redis end |
#sso_endpoint ⇒ String
34 35 36 |
# File 'lib/conversant/v3/base.rb', line 34 def sso_endpoint configuration.sso_endpoint end |
#validate_configuration! ⇒ void
This method returns an undefined value.
18 19 20 |
# File 'lib/conversant/v3/base.rb', line 18 def validate_configuration! Conversant.configuration.validate! end |