Class: AdfBuilder::Id

Inherits:
Object
  • Object
show all
Defined in:
lib/adf_builder/shared/id.rb

Instance Method Summary collapse

Constructor Details

#initializeId

Returns a new instance of Id.



3
4
5
# File 'lib/adf_builder/shared/id.rb', line 3

def initialize

end

Instance Method Details

#add(parent_node, value, source = nil, sequence = 1) ⇒ Object

add id tag to the form



8
9
10
11
12
13
14
15
16
17
18
# File 'lib/adf_builder/shared/id.rb', line 8

def add(parent_node, value, source=nil, sequence=1)
  id_node = Ox::Element.new('id')
  id_node << value
  id_node[:sequence] = sequence

  if source
    id_node[:source] = source
  end

  parent_node.prepend_child(id_node)
end