class Stupeflixclient::StupeflixXMLNode

Public Class Methods

new( nodeName, attributes = nil, children = nil, text = nil) click to toggle source
# File lib/stupeflixclient/stupeflix_client.rb, line 201
def initialize( nodeName, attributes = nil, children = nil, text = nil)
  @children = children
  @attributes = attributes
  @nodeName = nodeName
  @text = text
end

Public Instance Methods

metaChildrenAppend( meta = nil, notify = nil, children = nil) click to toggle source
# File lib/stupeflixclient/stupeflix_client.rb, line 236
def metaChildrenAppend( meta = nil, notify = nil, children = nil)
  childrenArray = []
  if meta
    childrenArray += [meta]
  end
  if notify
    childrenArray += [notify]
  end
  if children
    childrenArray += children
  end
  return childrenArray
end
xmlGet() click to toggle source
# File lib/stupeflixclient/stupeflix_client.rb, line 208
def xmlGet
  docXML = '<' + @nodeName
  if @attributes and @attributes.length != 0

    @attributes.each_pair do |k, v|
      docXML += " "
      if v == nil
        v = ""
      end
      k = k.to_s
      v = v.to_s
      docXML += k + '="' + CGI.escapeHTML(v) + '"'
    end
  end
  docXML += '>'
  if @children
    for c in @children
      docXML += c.xmlGet
    end
  end
  if @text
    docXML += @text
  end
  docXML += '</' + @nodeName + '>'

  return docXML
end