Class: EdifactConverter::XML::XftxParser::FTXElm

Inherits:
Struct
  • Object
show all
Defined in:
lib/edifact_converter/xml/xftx_parser.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#codeObject

Returns the value of attribute code

Returns:

  • (Object)

    the current value of code



112
113
114
# File 'lib/edifact_converter/xml/xftx_parser.rb', line 112

def code
  @code
end

#formatObject

Returns the value of attribute format

Returns:

  • (Object)

    the current value of format



112
113
114
# File 'lib/edifact_converter/xml/xftx_parser.rb', line 112

def format
  @format
end

#textsObject

Returns the value of attribute texts

Returns:

  • (Object)

    the current value of texts



112
113
114
# File 'lib/edifact_converter/xml/xftx_parser.rb', line 112

def texts
  @texts
end

Instance Method Details

#insert_before(node) ⇒ Object



113
114
115
116
117
118
119
120
121
122
123
124
125
126
# File 'lib/edifact_converter/xml/xftx_parser.rb', line 113

def insert_before(node)
  ftx =  Nokogiri::XML::Node.new "FTX", node.document
  Nokogiri::XML::Builder.with(ftx) do |xml|
    xml.Elm { xml.SubElm code }
    xml.Elm { xml.SubElm format }
    xml.Elm
    xml.Elm {
      texts.each do |text|
        xml.SubElm text
      end
    }
  end
  node.add_previous_sibling ftx
end