Class: FioAPI::Payments::Xml::Root
- Inherits:
-
Object
- Object
- FioAPI::Payments::Xml::Root
- Defined in:
- lib/base/payments/xml/root.rb
Constant Summary collapse
- XSI_OPTIONS =
{ 'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance', 'xsi:noNamespaceSchemaLocation' => 'http://www.fio.cz/schema/importIB.xsd' }.freeze
Instance Attribute Summary collapse
-
#payments ⇒ Object
readonly
Returns the value of attribute payments.
Instance Method Summary collapse
- #build ⇒ Object
-
#initialize(payments) ⇒ Root
constructor
A new instance of Root.
Constructor Details
#initialize(payments) ⇒ Root
12 13 14 |
# File 'lib/base/payments/xml/root.rb', line 12 def initialize(payments) @payments = payments end |
Instance Attribute Details
#payments ⇒ Object (readonly)
Returns the value of attribute payments.
10 11 12 |
# File 'lib/base/payments/xml/root.rb', line 10 def payments @payments end |
Instance Method Details
#build ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/base/payments/xml/root.rb', line 16 def build @build ||= Nokogiri::XML::Builder.new(encoding: 'UTF-8') do |xml| xml.Import(XSI_OPTIONS) do xml.Orders do payments.each do |payment| ::FioAPI::Payments::Xml::Item.new(xml, payment).build end end end end.to_xml end |