Class: Soaspec::SoapRequest

Inherits:
Object
  • Object
show all
Defined in:
lib/soaspec/exchange_handlers/request/soap_request.rb

Overview

Models a request made to a SOAP API

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(operation, body, request_option) ⇒ SoapRequest

Returns a new instance of SoapRequest.

Parameters:

  • operation (Symbol)

    Soap operation used

  • body (Hash)

    Hash with method of SOAP generated contained

  • request_option (Symbol)

    Method of building the request (:hash, :template)



24
25
26
27
28
# File 'lib/soaspec/exchange_handlers/request/soap_request.rb', line 24

def initialize(operation, body, request_option)
  self.body = body
  self.operation = operation
  self.request_option = request_option
end

Instance Attribute Details

#bodyHash

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

Examples:

{ xml: "<env:Envelope xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" ...</env:Body>\n</env:Envelope> " }

Returns:

  • (Hash)

    Body of request sent



15
16
17
# File 'lib/soaspec/exchange_handlers/request/soap_request.rb', line 15

def body
  @body
end

#operationSymbol

Returns SOAP operation used.

Examples:

SOAP operation

:login

Returns:

  • (Symbol)

    SOAP operation used



9
10
11
# File 'lib/soaspec/exchange_handlers/request/soap_request.rb', line 9

def operation
  @operation
end

#request_optionSymbol

Returns Method of building the request (:hash, :template).

Returns:

  • (Symbol)

    Method of building the request (:hash, :template)



17
18
19
# File 'lib/soaspec/exchange_handlers/request/soap_request.rb', line 17

def request_option
  @request_option
end

#test_nameString

Returns Name given to test to describe it.

Returns:

  • (String)

    Name given to test to describe it



19
20
21
# File 'lib/soaspec/exchange_handlers/request/soap_request.rb', line 19

def test_name
  @test_name
end

Instance Method Details

#[](value) ⇒ Object

Returns Result of retrieving value.

Parameters:

  • value (String, Symbol)

    Message to send to object retrieving a value

Returns:

  • (Object)

    Result of retrieving value



32
33
34
# File 'lib/soaspec/exchange_handlers/request/soap_request.rb', line 32

def [](value)
  send(value)
end

#to_sString

Returns Show inspection of all parameters.

Returns:

  • (String)

    Show inspection of all parameters



37
38
39
# File 'lib/soaspec/exchange_handlers/request/soap_request.rb', line 37

def to_s
  inspect
end