Class: XMLUtils::XMLSParserElement
- Inherits:
-
Object
- Object
- XMLUtils::XMLSParserElement
- Defined in:
- lib/stream_parser.rb
Instance Attribute Summary collapse
-
#element_id ⇒ Object
readonly
Returns the value of attribute element_id.
-
#elstart ⇒ Object
readonly
Returns the value of attribute elstart.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#parent ⇒ Object
readonly
Returns the value of attribute parent.
-
#parent_id ⇒ Object
readonly
Returns the value of attribute parent_id.
Class Method Summary collapse
Instance Method Summary collapse
- #consume ⇒ Object
- #content ⇒ Object
-
#initialize(name, elstart, parser, parent) ⇒ XMLSParserElement
constructor
A new instance of XMLSParserElement.
Constructor Details
#initialize(name, elstart, parser, parent) ⇒ XMLSParserElement
Returns a new instance of XMLSParserElement.
36 37 38 39 40 41 42 43 |
# File 'lib/stream_parser.rb', line 36 def initialize(name, elstart, parser, parent) @name = name @parser = parser @elstart = elstart @element_id = parser.new_element_id @parent = parent @parent_id = parent.element_id if parent end |
Instance Attribute Details
#element_id ⇒ Object (readonly)
Returns the value of attribute element_id.
32 33 34 |
# File 'lib/stream_parser.rb', line 32 def element_id @element_id end |
#elstart ⇒ Object (readonly)
Returns the value of attribute elstart.
34 35 36 |
# File 'lib/stream_parser.rb', line 34 def elstart @elstart end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
31 32 33 |
# File 'lib/stream_parser.rb', line 31 def name @name end |
#parent ⇒ Object (readonly)
Returns the value of attribute parent.
33 34 35 |
# File 'lib/stream_parser.rb', line 33 def parent @parent end |
#parent_id ⇒ Object (readonly)
Returns the value of attribute parent_id.
33 34 35 |
# File 'lib/stream_parser.rb', line 33 def parent_id @parent_id end |
Class Method Details
.root(parser) ⇒ Object
45 46 47 |
# File 'lib/stream_parser.rb', line 45 def self.root(parser) self.new("__XML_ROOT__", 0, parser, nil) end |
Instance Method Details
#consume ⇒ Object
53 54 55 |
# File 'lib/stream_parser.rb', line 53 def consume @parser.consume end |
#content ⇒ Object
49 50 51 |
# File 'lib/stream_parser.rb', line 49 def content @parser.contents.text_from(@elstart) end |