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

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#base_url(scheme: nil, server: self.server, server_variables: self.server_variables) ⇒ Object



108
109
110
111
112
113
# File 'lib/scorpio/openapi/document.rb', line 108

def base_url(scheme: nil, server: self.server, server_variables: self.server_variables)
  return @base_url if instance_variable_defined?(:@base_url)
  if server
    server.expanded_url(server_variables)
  end
end

#request_media_typeObject



116
117
118
119
# File 'lib/scorpio/openapi/document.rb', line 116

def request_media_type
  return @request_media_type if instance_variable_defined?(:@request_media_type)
  nil
end

#serverObject



94
95
96
97
98
99
100
101
# File 'lib/scorpio/openapi/document.rb', line 94

def server
  return @server if instance_variable_defined?(:@server)
  if servers.respond_to?(:to_ary) && servers.size == 1
    servers.first
  else
    nil
  end
end

#server_variablesObject



103
104
105
106
# File 'lib/scorpio/openapi/document.rb', line 103

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

Instance Method Details

#schemeObject



90
91
92
# File 'lib/scorpio/openapi/document.rb', line 90

def scheme
  nil
end