Sha256: 65dab85890214ce1cbb45adc597b9760ff62d7cd4a7a6a76686bc56d586091de
Contents?: true
Size: 1.6 KB
Versions: 5
Compression:
Stored size: 1.6 KB
Contents
module Soaspec # Models a request made to a REST API class RestRequest # @example GET method # :get # @return [Symbol] REST method used attr_accessor :method # @example JSON body # {"test":5} # @return [String] Body of request sent attr_accessor :body # @return [String] Name given to test to describe it attr_accessor :test_name # @return [String] User used in basic auth attr_accessor :basic_auth_user # @return [String] Password used in basic auth attr_accessor :basic_auth_password # @return [String] Url appended to base_url attr_accessor :suburl # @return [Hash] Miscellaneous parameters attr_accessor :other_params # Headers. Keys that are `symbols` will be converted from `snake_case` to `Word-Word2` # @return [Hash] Headers sent as part of request attr_accessor :headers def initialize(overall, options, body) overall_params = overall.dup # Must duplicate hash as deletion occurring self.body = body self.method = overall_params.delete(:method) self.suburl = overall_params.delete(:suburl) self.test_name = overall_params.delete(:name) self.other_params = overall_params self.basic_auth_user = options[:user] self.basic_auth_password = options[:password] self.headers = options[:headers] end # @param [String, Symbol] value Message to send to object retrieving a value # @return [Object] Result of retrieving value def [](value) self.send(value) end # @return [String] Show inspection of all parameters def to_s inspect end end end
Version data entries
5 entries across 5 versions & 1 rubygems