Sha256: b32dfc8ddf7f9f6a41976293d5a668453d68f52efd92c339b8de7dad7dfa820c

Contents?: true

Size: 1.36 KB

Versions: 5

Compression:

Stored size: 1.36 KB

Contents

module Soaspec
  # Models a request made to a SOAP API
  class SoapRequest
    # @example SOAP operation
    #   :login
    # @return [Symbol] SOAP operation used
    attr_accessor :operation
    # Hash representing what will be sent to Savon. Either the exact xml (if using a template)
    # or a message Hash that will be converted to XML by Savon
    # @example
    #   { xml: "<env:Envelope xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" ...</env:Body>\n</env:Envelope> " }
    # @return [Hash] Body of request sent
    attr_accessor :body
    # @return [Symbol] Method of building the request (:hash, :template)
    attr_accessor :request_option
    # @return [String] Name given to test to describe it
    attr_accessor :test_name

    # @param [Symbol] operation Soap operation used
    # @param [Hash] body Hash with method of SOAP generated contained
    # @param [Symbol] request_option Method of building the request (:hash, :template)
    def initialize(operation, body, request_option)
      self.body = body
      self.operation = operation
      self.request_option = request_option
    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

Version Path
soaspec-0.2.29 lib/soaspec/exchange_handlers/request/soap_request.rb
soaspec-0.2.28 lib/soaspec/exchange_handlers/request/soap_request.rb
soaspec-0.2.27 lib/soaspec/exchange_handlers/request/soap_request.rb
soaspec-0.2.26 lib/soaspec/exchange_handlers/request/soap_request.rb
soaspec-0.2.25 lib/soaspec/exchange_handlers/request/soap_request.rb