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.



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_idObject

Returns the value of attribute application_id.



24
25
26
# File 'lib/updox.rb', line 24

def application_id
  @application_id
end

#application_passwordObject

Returns the value of attribute application_password.



24
25
26
# File 'lib/updox.rb', line 24

def application_password
  @application_password
end

#failure_actionObject

Returns the value of attribute failure_action.



25
26
27
# File 'lib/updox.rb', line 25

def failure_action
  @failure_action
end

#parse_responsesObject 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_endpointObject



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_hObject



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