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.
-
#failure_action ⇒ Object
Returns the value of attribute failure_action.
-
#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.
29 30 31 32 33 34 |
# File 'lib/updox.rb', line 29 def initialize @application_id = nil @application_password = nil @parse_responses = true @failure_action = nil end |
Instance Attribute Details
#application_id ⇒ Object
Returns the value of attribute application_id.
24 25 26 |
# File 'lib/updox.rb', line 24 def application_id @application_id end |
#application_password ⇒ Object
Returns the value of attribute application_password.
24 25 26 |
# File 'lib/updox.rb', line 24 def application_password @application_password end |
#failure_action ⇒ Object
Returns the value of attribute failure_action.
25 26 27 |
# File 'lib/updox.rb', line 25 def failure_action @failure_action end |
#parse_responses ⇒ Object Also known as: parse_responses?
Returns the value of attribute parse_responses.
24 25 26 |
# File 'lib/updox.rb', line 24 def parse_responses @parse_responses end |
Instance Method Details
#api_endpoint ⇒ Object
45 46 47 |
# File 'lib/updox.rb', line 45 def api_endpoint return Connection.base_uri end |
#api_endpoint=(endpoint) ⇒ Object
41 42 43 |
# File 'lib/updox.rb', line 41 def api_endpoint=(endpoint) Connection.base_uri(endpoint.freeze) end |
#from_h(h) ⇒ Object
59 60 61 62 63 64 65 66 67 |
# File 'lib/updox.rb', line 59 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] self.failure_action = h[:failure_action] return self end |
#to_h ⇒ Object
49 50 51 52 53 54 55 56 57 |
# File 'lib/updox.rb', line 49 def to_h return { application_id: @application_id, application_password: @application_password, api_endpoint: api_endpoint, parse_responses: @parse_responses, failure_action: @failure_action } end |