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



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

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> " }


13
14
15
# File 'lib/soaspec/exchange_handlers/request/soap_request.rb', line 13

def body
  @body
end

#operationSymbol

Returns SOAP operation used.

Examples:

SOAP operation

:login


7
8
9
# File 'lib/soaspec/exchange_handlers/request/soap_request.rb', line 7

def operation
  @operation
end

#request_optionSymbol



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

def request_option
  @request_option
end

#test_nameString



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

def test_name
  @test_name
end

Instance Method Details

#[](value) ⇒ Object



30
31
32
# File 'lib/soaspec/exchange_handlers/request/soap_request.rb', line 30

def [](value)
  self.send(value)
end

#to_sString



35
36
37
# File 'lib/soaspec/exchange_handlers/request/soap_request.rb', line 35

def to_s
  inspect
end