Class: VEText::Configuration

Inherits:
Common::Client::Configuration::REST show all
Defined in:
lib/vetext/configuration.rb

Instance Attribute Summary

Attributes inherited from Common::Client::Configuration::Base

#base_request_headers, #open_timeout, #read_timeout, #request_types, #user_agent

Instance Method Summary collapse

Methods inherited from Common::Client::Configuration::Base

#breakers_error_threshold, #breakers_exception_handler, #breakers_matcher, #breakers_service, #create_new_breakers_service, #current_module, #request_options, #service_exception

Instance Method Details

#base_pathObject



8
9
10
# File 'lib/vetext/configuration.rb', line 8

def base_path
  Settings.vetext_push.base_url
end

#connectionObject



16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/vetext/configuration.rb', line 16

def connection
  @connection ||= Faraday.new(
    base_path, headers: base_request_headers, request: request_options
  ) do |conn|
    conn.use :breakers
    conn.request :authorization, :basic, Settings.vetext_push.user, Settings.vetext_push.pass
    conn.request :json
    conn.use Faraday::Response::RaiseError
    conn.response :snakecase
    conn.response :json, content_type: /\bjson$/
    conn.response :vetext_error
    conn.adapter Faraday.default_adapter
  end
end

#service_nameObject



12
13
14
# File 'lib/vetext/configuration.rb', line 12

def service_name
  'VEText'
end