Class: Facturae::PartiesBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/facturae/builders/parties_builder.rb

Overview

Builds the XML representation of the parties.

Instance Method Summary collapse

Constructor Details

#initialize(seller_party, buyer_party) ⇒ PartiesBuilder

Returns a new instance of PartiesBuilder.



6
7
8
9
# File 'lib/facturae/builders/parties_builder.rb', line 6

def initialize(seller_party, buyer_party)
  @seller_party = seller_party
  @buyer_party  = buyer_party
end

Instance Method Details

#build(xml) ⇒ Object



11
12
13
14
15
16
17
18
19
20
# File 'lib/facturae/builders/parties_builder.rb', line 11

def build(xml)
  xml.Parties do
    xml.SellerParty do
      build_party(xml, @seller_party)
    end
    xml.BuyerParty do
      build_party(xml, @buyer_party)
    end
  end
end