class TpagaService::Swagger::Request
Attributes
auth_names[RW]
require 'uri' require 'addressable/uri' require 'typhoeus'
body[RW]
require 'uri' require 'addressable/uri' require 'typhoeus'
form_params[RW]
require 'uri' require 'addressable/uri' require 'typhoeus'
format[RW]
require 'uri' require 'addressable/uri' require 'typhoeus'
headers[RW]
require 'uri' require 'addressable/uri' require 'typhoeus'
host[RW]
require 'uri' require 'addressable/uri' require 'typhoeus'
http_method[RW]
require 'uri' require 'addressable/uri' require 'typhoeus'
params[RW]
require 'uri' require 'addressable/uri' require 'typhoeus'
path[RW]
require 'uri' require 'addressable/uri' require 'typhoeus'
Public Class Methods
new(http_method, path, attributes={})
click to toggle source
All requests must have an HTTP method and a path Optionals parameters are :params, :headers, :body, :format, :host
# 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