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.
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.
13 14 15 16 |
# File 'lib/updox.rb', line 13 def initialize @application_id = nil @application_password = nil end |
Instance Attribute Details
#application_id ⇒ Object
Returns the value of attribute application_id.
11 12 13 |
# File 'lib/updox.rb', line 11 def application_id @application_id end |
#application_password ⇒ Object
Returns the value of attribute application_password.
11 12 13 |
# File 'lib/updox.rb', line 11 def application_password @application_password end |
Instance Method Details
#api_endpoint ⇒ Object
22 23 24 |
# File 'lib/updox.rb', line 22 def api_endpoint return Connection.base_uri end |
#api_endpoint=(endpoint) ⇒ Object
18 19 20 |
# File 'lib/updox.rb', line 18 def api_endpoint=(endpoint) Connection.base_uri(endpoint.freeze) end |
#from_h(h) ⇒ Object
34 35 36 37 38 39 40 |
# File 'lib/updox.rb', line 34 def from_h(h) self.application_id = h[:application_id] self.application_password = h[:application_password] self.api_endpoint = h[:api_endpoint] return self end |
#to_h ⇒ Object
26 27 28 29 30 31 32 |
# File 'lib/updox.rb', line 26 def to_h return { application_id: @application_id, application_password: @application_password, api_endpoint: api_endpoint } end |