Class: RXaal::Seq

Inherits:
TopLevelElem show all
Defined in:
lib/seq.rb

Instance Attribute Summary collapse

Attributes inherited from XaalElement

#doc, #id, #refs

Instance Method Summary collapse

Methods inherited from TopLevelElem

#superclass_serialize

Methods inherited from XaalElement

#add_attribute, #add_ref, get_new_default_id, modify_ref, #rm_ref, #superclass_serialize

Constructor Details

#initialize(doc) ⇒ Seq

Returns a new instance of Seq.



7
8
9
10
# File 'lib/seq.rb', line 7

def initialize(doc)
  super(doc)
  @pars = BoundArray.new(Par)
end

Instance Attribute Details

#narrativeObject

narrative does not do type checking currently



5
6
7
# File 'lib/seq.rb', line 5

def narrative
  @narrative
end

#parsObject (readonly)

Returns the value of attribute pars.



3
4
5
# File 'lib/seq.rb', line 3

def pars
  @pars
end

Instance Method Details

#xaal_serialize(parent) ⇒ Object



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/seq.rb', line 14

def xaal_serialize(parent)
  e = Element.new "seq"
  parent.elements << e
  
  if @narrative != nil
    n = Element.new "narrative"
    n.text=(@narrative)
    e.elements << n
  end
  
  pars.each { |p|
    p.xaal_serialize(e)
  }
  
  superclass_serialize(e)
end