Class: XmlConv::I2::Document

Inherits:
Object
  • Object
show all
Defined in:
lib/xmlconv/i2/document.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeDocument

Returns a new instance of Document.



12
13
14
15
# File 'lib/xmlconv/i2/document.rb', line 12

def initialize
     @header = Header.new
  @orders = []
end

Instance Attribute Details

#headerObject

Returns the value of attribute header.



10
11
12
# File 'lib/xmlconv/i2/document.rb', line 10

def header
  @header
end

#ordersObject (readonly)

Returns the value of attribute orders.



11
12
13
# File 'lib/xmlconv/i2/document.rb', line 11

def orders
  @orders
end

Instance Method Details

#add_order(order) ⇒ Object



16
17
18
# File 'lib/xmlconv/i2/document.rb', line 16

def add_order(order)
  @orders.push(order)
end

#filenameObject



19
20
21
# File 'lib/xmlconv/i2/document.rb', line 19

def filename
  @header.filename
end

#to_sObject



22
23
24
# File 'lib/xmlconv/i2/document.rb', line 22

def to_s
  ([@header] + @orders).join
end