Class: Updox::Configuration
- Inherits:
-
Object
- Object
- Updox::Configuration
- Defined in:
- lib/updox.rb
Instance Attribute Summary collapse
-
#application_id ⇒ Object
Returns the value of attribute application_id.
-
#application_password ⇒ Object
Returns the value of attribute application_password.
-
#parse_responses ⇒ Object
(also: #parse_responses?)
Returns the value of attribute parse_responses.
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.
22 23 24 25 26 |
# File 'lib/updox.rb', line 22 def initialize @application_id = nil @application_password = nil @parse_responses = true end |
Instance Attribute Details
#application_id ⇒ Object
Returns the value of attribute application_id.
18 19 20 |
# File 'lib/updox.rb', line 18 def application_id @application_id end |
#application_password ⇒ Object
Returns the value of attribute application_password.
18 19 20 |
# File 'lib/updox.rb', line 18 def application_password @application_password end |
#parse_responses ⇒ Object Also known as: parse_responses?
Returns the value of attribute parse_responses.
18 19 20 |
# File 'lib/updox.rb', line 18 def parse_responses @parse_responses end |
Instance Method Details
#api_endpoint ⇒ Object
32 33 34 |
# File 'lib/updox.rb', line 32 def api_endpoint return Connection.base_uri end |
#api_endpoint=(endpoint) ⇒ Object
28 29 30 |
# File 'lib/updox.rb', line 28 def api_endpoint=(endpoint) Connection.base_uri(endpoint.freeze) end |
#from_h(h) ⇒ Object
45 46 47 48 49 50 51 52 |
# File 'lib/updox.rb', line 45 def from_h(h) self.application_id = h[:application_id] self.application_password = h[:application_password] self.api_endpoint = h[:api_endpoint] self.parse_responses = h[:parse_responses] return self end |
#to_h ⇒ Object
36 37 38 39 40 41 42 43 |
# File 'lib/updox.rb', line 36 def to_h return { application_id: @application_id, application_password: @application_password, api_endpoint: api_endpoint, parse_responses: @parse_responses } end |