Class: Vigia::HttpClient::Options
- Inherits:
-
OpenStruct
- Object
- OpenStruct
- Vigia::HttpClient::Options
- Defined in:
- lib/vigia/http_client/options.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.build(context, in_let_context) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/vigia/http_client/options.rb', line 5 def build(context, in_let_context) instance = new instance.context = context instance..each do |name, value| instance[name] = context.contextual_object(object: value, context: in_let_context) end instance.headers ||= {} instance.use_uri_template if instance.uri_template instance.include_config_headers if Vigia.config.headers.any? instance end |
Instance Method Details
#include_config_headers ⇒ Object
26 27 28 |
# File 'lib/vigia/http_client/options.rb', line 26 def include_config_headers self.headers.merge!(Vigia.config.headers) end |
#options ⇒ Object
18 19 20 |
# File 'lib/vigia/http_client/options.rb', line 18 def context.[:http_client_options] || {} end |