Class: Updox::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/updox.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



26
27
28
29
30
31
# File 'lib/updox.rb', line 26

def initialize
  @application_id       = nil
  @application_password = nil
  @parse_responses      = true
  @failure_action       = nil
end

Instance Attribute Details

#application_idObject

Returns the value of attribute application_id.



21
22
23
# File 'lib/updox.rb', line 21

def application_id
  @application_id
end

#application_passwordObject

Returns the value of attribute application_password.



21
22
23
# File 'lib/updox.rb', line 21

def application_password
  @application_password
end

#failure_actionObject

Returns the value of attribute failure_action.



22
23
24
# File 'lib/updox.rb', line 22

def failure_action
  @failure_action
end

#parse_responsesObject Also known as: parse_responses?

Returns the value of attribute parse_responses.



21
22
23
# File 'lib/updox.rb', line 21

def parse_responses
  @parse_responses
end

Instance Method Details

#api_endpointObject



42
43
44
# File 'lib/updox.rb', line 42

def api_endpoint
  return Connection.base_uri
end

#api_endpoint=(endpoint) ⇒ Object



38
39
40
# File 'lib/updox.rb', line 38

def api_endpoint=(endpoint)
  Connection.base_uri(endpoint.freeze)
end

#from_h(h) ⇒ Object



56
57
58
59
60
61
62
63
64
# File 'lib/updox.rb', line 56

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_hObject



46
47
48
49
50
51
52
53
54
# File 'lib/updox.rb', line 46

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