Class: Bambora::Builders::XMLRequestBody
- Inherits:
-
Object
- Object
- Bambora::Builders::XMLRequestBody
- Defined in:
- lib/bambora/builders/xml_request_body.rb
Overview
Builds an XML request body from a Hash
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
Instance Method Summary collapse
-
#initialize(body:) ⇒ XMLRequestBody
constructor
A new instance of XMLRequestBody.
- #to_s ⇒ Object
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
#body ⇒ Object (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_s ⇒ Object
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 |