Class: ChangeHealth::Configuration
- Inherits:
-
Object
- Object
- ChangeHealth::Configuration
- Defined in:
- lib/change_health.rb
Instance Attribute Summary collapse
-
#auth_headers ⇒ Object
Returns the value of attribute auth_headers.
-
#client_id ⇒ Object
Returns the value of attribute client_id.
-
#client_secret ⇒ Object
Returns the value of attribute client_secret.
-
#endpoints ⇒ Object
Returns the value of attribute endpoints.
-
#grant_type ⇒ Object
Returns the value of attribute grant_type.
Instance Method Summary collapse
- #api_endpoint ⇒ Object
- #api_endpoint=(endpoint) ⇒ Object
- #from_h(other_hash) ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #to_h ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
70 71 72 73 74 75 76 |
# File 'lib/change_health.rb', line 70 def initialize @auth_headers = nil @client_id = nil @client_secret = nil @endpoints = nil @grant_type = :client_credentials end |
Instance Attribute Details
#auth_headers ⇒ Object
Returns the value of attribute auth_headers.
68 69 70 |
# File 'lib/change_health.rb', line 68 def auth_headers @auth_headers end |
#client_id ⇒ Object
Returns the value of attribute client_id.
68 69 70 |
# File 'lib/change_health.rb', line 68 def client_id @client_id end |
#client_secret ⇒ Object
Returns the value of attribute client_secret.
68 69 70 |
# File 'lib/change_health.rb', line 68 def client_secret @client_secret end |
#endpoints ⇒ Object
Returns the value of attribute endpoints.
68 69 70 |
# File 'lib/change_health.rb', line 68 def endpoints @endpoints end |
#grant_type ⇒ Object
Returns the value of attribute grant_type.
68 69 70 |
# File 'lib/change_health.rb', line 68 def grant_type @grant_type end |
Instance Method Details
#api_endpoint ⇒ Object
82 83 84 |
# File 'lib/change_health.rb', line 82 def api_endpoint Connection.base_uri end |
#api_endpoint=(endpoint) ⇒ Object
78 79 80 |
# File 'lib/change_health.rb', line 78 def api_endpoint=(endpoint) Connection.base_uri(endpoint.freeze) end |
#from_h(other_hash) ⇒ Object
97 98 99 100 101 102 103 104 105 106 |
# File 'lib/change_health.rb', line 97 def from_h(other_hash) self.auth_headers = other_hash[:auth_headers] self.client_id = other_hash[:client_id] self.client_secret = other_hash[:client_secret] self.endpoints = other_hash[:endpoints] self.grant_type = other_hash[:grant_type] self.api_endpoint = other_hash[:api_endpoint] self end |
#to_h ⇒ Object
86 87 88 89 90 91 92 93 94 95 |
# File 'lib/change_health.rb', line 86 def to_h { auth_headers: @auth_headers, client_id: @client_id, client_secret: @client_secret, endpoints: @endpoints, grant_type: @grant_type, api_endpoint: api_endpoint } end |