Class: Stupeflixclient::StupeflixXMLNode
- Inherits:
-
Object
- Object
- Stupeflixclient::StupeflixXMLNode
- Defined in:
- lib/stupeflixclient/stupeflix_client.rb
Direct Known Subclasses
StupeflixHttpHeader, StupeflixMeta, StupeflixNotify, StupeflixProfile, StupeflixProfileSet, StupeflixUpload
Instance Method Summary collapse
-
#initialize(nodeName, attributes = nil, children = nil, text = nil) ⇒ StupeflixXMLNode
constructor
A new instance of StupeflixXMLNode.
- #metaChildrenAppend(meta = nil, notify = nil, children = nil) ⇒ Object
- #xmlGet ⇒ Object
Constructor Details
#initialize(nodeName, attributes = nil, children = nil, text = nil) ⇒ StupeflixXMLNode
Returns a new instance of StupeflixXMLNode.
201 202 203 204 205 206 |
# 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 |
Instance Method Details
#metaChildrenAppend(meta = nil, notify = nil, children = nil) ⇒ Object
236 237 238 239 240 241 242 243 244 245 246 247 248 |
# File 'lib/stupeflixclient/stupeflix_client.rb', line 236 def ( = nil, notify = nil, children = nil) childrenArray = [] if childrenArray += [] end if notify childrenArray += [notify] end if children childrenArray += children end return childrenArray end |
#xmlGet ⇒ Object
208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 |
# 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 |