Class: TpagaService::Swagger::Request
- Inherits:
-
Object
- Object
- TpagaService::Swagger::Request
- Defined in:
- lib/tpaga_service/swagger/request.rb
Instance Attribute Summary collapse
-
#auth_names ⇒ Object
require ‘uri’ require ‘addressable/uri’ require ‘typhoeus’.
-
#body ⇒ Object
require ‘uri’ require ‘addressable/uri’ require ‘typhoeus’.
-
#form_params ⇒ Object
require ‘uri’ require ‘addressable/uri’ require ‘typhoeus’.
-
#format ⇒ Object
require ‘uri’ require ‘addressable/uri’ require ‘typhoeus’.
-
#headers ⇒ Object
require ‘uri’ require ‘addressable/uri’ require ‘typhoeus’.
-
#host ⇒ Object
require ‘uri’ require ‘addressable/uri’ require ‘typhoeus’.
-
#http_method ⇒ Object
require ‘uri’ require ‘addressable/uri’ require ‘typhoeus’.
-
#params ⇒ Object
require ‘uri’ require ‘addressable/uri’ require ‘typhoeus’.
-
#path ⇒ Object
require ‘uri’ require ‘addressable/uri’ require ‘typhoeus’.
Instance Method Summary collapse
-
#initialize(http_method, path, attributes = {}) ⇒ Request
constructor
All requests must have an HTTP method and a path Optionals parameters are :params, :headers, :body, :format, :host.
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_names ⇒ Object
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 |
#body ⇒ Object
require ‘uri’ require ‘addressable/uri’ require ‘typhoeus’
8 9 10 |
# File 'lib/tpaga_service/swagger/request.rb', line 8 def body @body end |
#form_params ⇒ Object
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 |
#format ⇒ Object
require ‘uri’ require ‘addressable/uri’ require ‘typhoeus’
8 9 10 |
# File 'lib/tpaga_service/swagger/request.rb', line 8 def format @format end |
#headers ⇒ Object
require ‘uri’ require ‘addressable/uri’ require ‘typhoeus’
8 9 10 |
# File 'lib/tpaga_service/swagger/request.rb', line 8 def headers @headers end |
#host ⇒ Object
require ‘uri’ require ‘addressable/uri’ require ‘typhoeus’
8 9 10 |
# File 'lib/tpaga_service/swagger/request.rb', line 8 def host @host end |
#http_method ⇒ Object
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 |
#params ⇒ Object
require ‘uri’ require ‘addressable/uri’ require ‘typhoeus’
8 9 10 |
# File 'lib/tpaga_service/swagger/request.rb', line 8 def params @params end |
#path ⇒ Object
require ‘uri’ require ‘addressable/uri’ require ‘typhoeus’
8 9 10 |
# File 'lib/tpaga_service/swagger/request.rb', line 8 def path @path end |