Class: XMLUtils::XMLSParserContents
- Inherits:
-
Object
- Object
- XMLUtils::XMLSParserContents
- Defined in:
- lib/stream_parser.rb
Instance Method Summary collapse
- #<<(content) ⇒ Object
- #add(content) ⇒ Object
- #erase_from(start) ⇒ Object
-
#initialize ⇒ XMLSParserContents
constructor
A new instance of XMLSParserContents.
- #size ⇒ Object
- #text_from(start) ⇒ Object
Constructor Details
#initialize ⇒ XMLSParserContents
Returns a new instance of XMLSParserContents.
5 6 7 |
# File 'lib/stream_parser.rb', line 5 def initialize @contents = [] end |
Instance Method Details
#<<(content) ⇒ Object
13 14 15 |
# File 'lib/stream_parser.rb', line 13 def <<(content) add(content) end |
#add(content) ⇒ Object
9 10 11 |
# File 'lib/stream_parser.rb', line 9 def add(content) @contents << content end |
#erase_from(start) ⇒ Object
25 26 27 |
# File 'lib/stream_parser.rb', line 25 def erase_from(start) @contents = @contents[0..(start-1)] end |
#size ⇒ Object
21 22 23 |
# File 'lib/stream_parser.rb', line 21 def size @contents.size end |
#text_from(start) ⇒ Object
17 18 19 |
# File 'lib/stream_parser.rb', line 17 def text_from(start) @contents[start..-1].join end |