Module: Scorpio::OpenAPI::Document::Configurables

Included in:
Scorpio::OpenAPI::Document
Defined in:
lib/scorpio/openapi/document.rb

Instance Attribute Summary collapse

Instance Attribute Details

#faraday_adapterObject



55
56
57
58
# File 'lib/scorpio/openapi/document.rb', line 55

def faraday_adapter
  return @faraday_adapter if instance_variable_defined?(:@faraday_adapter)
  [Faraday.default_adapter].freeze
end

#faraday_builderObject



49
50
51
52
# File 'lib/scorpio/openapi/document.rb', line 49

def faraday_builder
  return @faraday_builder if instance_variable_defined?(:@faraday_builder)
  -> (_) { }
end

#loggerObject



61
62
63
64
# File 'lib/scorpio/openapi/document.rb', line 61

def logger
  return @logger if instance_variable_defined?(:@logger)
  (Object.const_defined?(:Rails) && ::Rails.respond_to?(:logger) ? ::Rails.logger : nil)
end

#request_headersObject



37
38
39
40
# File 'lib/scorpio/openapi/document.rb', line 37

def request_headers
  return @request_headers if instance_variable_defined?(:@request_headers)
  {}.freeze
end

#user_agentObject



43
44
45
46
# File 'lib/scorpio/openapi/document.rb', line 43

def user_agent
  return @user_agent if instance_variable_defined?(:@user_agent)
  "Scorpio/#{Scorpio::VERSION} (https://github.com/notEthan/scorpio) Faraday/#{Faraday::VERSION} Ruby/#{RUBY_VERSION}"
end