Class: GI::Configuration
- Inherits:
-
Common::Client::Configuration::REST
- Object
- Common::Client::Configuration::Base
- Common::Client::Configuration::REST
- GI::Configuration
- Defined in:
- lib/gi/configuration.rb
Direct Known Subclasses
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
- #base_path ⇒ Object
- #connection ⇒ Object
- #service_name ⇒ Object
-
#use_mocks? ⇒ Boolean
To be overridden in gi/lce/configuration.
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_path ⇒ Object
14 15 16 |
# File 'lib/gi/configuration.rb', line 14 def base_path "#{Settings.gids.url}/" end |
#connection ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/gi/configuration.rb', line 22 def connection Faraday.new(base_path, headers: base_request_headers, request: ) do |conn| conn.use :breakers conn.request :json # Uncomment this out for generating curl output # conn.request :curl, ::Logger.new(STDOUT), :warn # conn.response :logger, ::Logger.new(STDOUT), bodies: true conn.response :betamocks if use_mocks? conn.response :snakecase conn.response :raise_custom_error, error_prefix: service_name conn.response :gids_errors conn.response :json_parser conn.adapter Faraday.default_adapter end end |
#service_name ⇒ Object
18 19 20 |
# File 'lib/gi/configuration.rb', line 18 def service_name 'GI' end |
#use_mocks? ⇒ Boolean
To be overridden in gi/lce/configuration
41 42 43 |
# File 'lib/gi/configuration.rb', line 41 def use_mocks? false end |