Class: Bambora::Builders::XMLRequestBody

Inherits:
Object
  • Object
show all
Defined in:
lib/bambora/builders/xml_request_body.rb

Overview

Builds an XML request body from a Hash

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(body:) ⇒ XMLRequestBody

Returns a new instance of XMLRequestBody.



10
11
12
# File 'lib/bambora/builders/xml_request_body.rb', line 10

def initialize(body:)
  @body = body
end

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



8
9
10
# File 'lib/bambora/builders/xml_request_body.rb', line 8

def body
  @body
end

Instance Method Details

#to_sObject



14
15
16
# File 'lib/bambora/builders/xml_request_body.rb', line 14

def to_s
  "<?xml version='1.0' encoding='utf-8'?>#{Gyoku.xml(request: body)}"
end