Class: ChangeHealth::Configuration
- Inherits:
-
Object
- Object
- ChangeHealth::Configuration
- Defined in:
- lib/change_health.rb
Instance Attribute Summary collapse
-
#client_id ⇒ Object
Returns the value of attribute client_id.
-
#client_secret ⇒ Object
Returns the value of attribute client_secret.
-
#grant_type ⇒ Object
Returns the value of attribute grant_type.
Instance Method Summary collapse
- #api_endpoint ⇒ Object
- #api_endpoint=(endpoint) ⇒ Object
- #from_h(h) ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #to_h ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
41 42 43 44 45 |
# File 'lib/change_health.rb', line 41 def initialize @client_id = nil @client_secret = nil @grant_type = :client_credentials end |
Instance Attribute Details
#client_id ⇒ Object
Returns the value of attribute client_id.
39 40 41 |
# File 'lib/change_health.rb', line 39 def client_id @client_id end |
#client_secret ⇒ Object
Returns the value of attribute client_secret.
39 40 41 |
# File 'lib/change_health.rb', line 39 def client_secret @client_secret end |
#grant_type ⇒ Object
Returns the value of attribute grant_type.
39 40 41 |
# File 'lib/change_health.rb', line 39 def grant_type @grant_type end |
Instance Method Details
#api_endpoint ⇒ Object
51 52 53 |
# File 'lib/change_health.rb', line 51 def api_endpoint Connection.base_uri end |
#api_endpoint=(endpoint) ⇒ Object
47 48 49 |
# File 'lib/change_health.rb', line 47 def api_endpoint=(endpoint) Connection.base_uri(endpoint.freeze) end |
#from_h(h) ⇒ Object
64 65 66 67 68 69 70 71 |
# File 'lib/change_health.rb', line 64 def from_h(h) self.client_id = h[:client_id] self.client_secret = h[:client_secret] self.grant_type = h[:grant_type] self.api_endpoint = h[:api_endpoint] self end |
#to_h ⇒ Object
55 56 57 58 59 60 61 62 |
# File 'lib/change_health.rb', line 55 def to_h { client_id: @client_id, client_secret: @client_secret, grant_type: @grant_type, api_endpoint: api_endpoint } end |