Class: VEText::Configuration
Instance Attribute Summary
#base_request_headers, #open_timeout, #read_timeout, #request_types, #user_agent
Instance Method Summary
collapse
#breakers_error_threshold, #breakers_exception_handler, #breakers_matcher, #breakers_service, #create_new_breakers_service, #current_module, #request_options, #service_exception
Instance Method Details
#base_path ⇒ Object
8
9
10
|
# File 'lib/vetext/configuration.rb', line 8
def base_path
Settings.vetext_push.base_url
end
|
#connection ⇒ Object
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: , 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_name ⇒ Object
12
13
14
|
# File 'lib/vetext/configuration.rb', line 12
def service_name
'VEText'
end
|