Class: TpagaService::Swagger::Request

Inherits:
Object
  • Object
show all
Defined in:
lib/tpaga_service/swagger/request.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(http_method, path, attributes = {}) ⇒ Request

All requests must have an HTTP method and a path Optionals parameters are :params, :headers, :body, :format, :host



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/tpaga_service/swagger/request.rb', line 12

def initialize(http_method, path, attributes={})
  # attributes[:format] ||= Swagger.configuration.format
  # attributes[:params] ||= {}
  #
  # # Set default headers
  # default_headers = {
  #   'Content-Type' => "application/#{attributes[:format].downcase}",
  #   'User-Agent' => Swagger.configuration.user_agent
  # }
  #
  # # Merge argument headers into defaults
  # attributes[:headers] = default_headers.merge(attributes[:headers] || {})
  #
  # # Stick in the auth token if there is one
  # if Swagger.authenticated?
  #   attributes[:headers].merge!({:auth_token => Swagger.configuration.auth_token})
  # end
  #
  # self.http_method = http_method.to_sym
  # self.path = path
  # attributes.each do |name, value|
  #   send("#{name.to_s.underscore.to_sym}=", value)
  # end
  #
  # update_params_for_auth!
end

Instance Attribute Details

#auth_namesObject

require ‘uri’ require ‘addressable/uri’ require ‘typhoeus’



8
9
10
# File 'lib/tpaga_service/swagger/request.rb', line 8

def auth_names
  @auth_names
end

#bodyObject

require ‘uri’ require ‘addressable/uri’ require ‘typhoeus’



8
9
10
# File 'lib/tpaga_service/swagger/request.rb', line 8

def body
  @body
end

#form_paramsObject

require ‘uri’ require ‘addressable/uri’ require ‘typhoeus’



8
9
10
# File 'lib/tpaga_service/swagger/request.rb', line 8

def form_params
  @form_params
end

#formatObject

require ‘uri’ require ‘addressable/uri’ require ‘typhoeus’



8
9
10
# File 'lib/tpaga_service/swagger/request.rb', line 8

def format
  @format
end

#headersObject

require ‘uri’ require ‘addressable/uri’ require ‘typhoeus’



8
9
10
# File 'lib/tpaga_service/swagger/request.rb', line 8

def headers
  @headers
end

#hostObject

require ‘uri’ require ‘addressable/uri’ require ‘typhoeus’



8
9
10
# File 'lib/tpaga_service/swagger/request.rb', line 8

def host
  @host
end

#http_methodObject

require ‘uri’ require ‘addressable/uri’ require ‘typhoeus’



8
9
10
# File 'lib/tpaga_service/swagger/request.rb', line 8

def http_method
  @http_method
end

#paramsObject

require ‘uri’ require ‘addressable/uri’ require ‘typhoeus’



8
9
10
# File 'lib/tpaga_service/swagger/request.rb', line 8

def params
  @params
end

#pathObject

require ‘uri’ require ‘addressable/uri’ require ‘typhoeus’



8
9
10
# File 'lib/tpaga_service/swagger/request.rb', line 8

def path
  @path
end