class Noodlecr

Noodlecr inherit to Noodle::Node you need to read Noodle::Node for understand how we work !

Public Class Methods

new() click to toggle source
Calls superclass method Noodle::Node::new
# File lib/noodlecr.rb, line 5
def initialize
  super "superfather"
  @big_father = nil
end

Public Instance Methods

to_xml(encoding = false) click to toggle source

we override to_xml because Noodlecr is special node without name, Noodlecr is a big father ! Becarefull : we return a string value !! Need to rename this method to_s ?

# File lib/noodlecr.rb, line 12
def to_xml(encoding = false)
  data = "<?xml version=\"1.0\"#{" encoding=\"utf-8\"" if encoding}?>" # useless encoding ? i don't know said me
  @childs.each do |child|
    data += child.to_xml
  end
  return data
end