class Updox::Configuration

Attributes

application_id[RW]
application_password[RW]
failure_action[R]
parse_responses[RW]
parse_responses?[RW]

Public Class Methods

new() click to toggle source
# File lib/updox.rb, line 29
def initialize
  @application_id       = nil
  @application_password = nil
  @parse_responses      = true
  @failure_action       = nil
end

Public Instance Methods

api_endpoint() click to toggle source
# File lib/updox.rb, line 45
def api_endpoint
  return Connection.base_uri
end
api_endpoint=(endpoint) click to toggle source
# File lib/updox.rb, line 41
def api_endpoint=(endpoint)
  Connection.base_uri(endpoint.freeze)
end
failure_action=(value) click to toggle source
# File lib/updox.rb, line 36
def failure_action=(value)
  raise "Failure action must be 'nil', ':raise' or callable object!" unless value.nil? || value.respond_to?(:call) || :raise == value
  @failure_action = value
end
from_h(h) click to toggle source
# 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() click to toggle source
# 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