Class: HtmlGen::Parser
- Inherits:
-
Object
- Object
- HtmlGen::Parser
- Defined in:
- lib/html_gen/parser.rb
Overview
Instance Attribute Summary collapse
-
#eles ⇒ Object
readonly
An array that holds all the parsed root-elements.
Instance Method Summary collapse
-
#initialize(args) ⇒ Parser
constructor
The constructor.
Constructor Details
#initialize(args) ⇒ Parser
The constructor. See class documentation for usage of this.
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/html_gen/parser.rb', line 11 def initialize(args) if args[:io] @io = args[:io] elsif args[:str] @io = ::StringIO.new(args[:str]) else raise "Dont know how to handle given arguments." end raise "No ':io' was given." unless @io @eof = false @buffer = "" @eles = [] @eles_t = [] @debug = args[:debug] while !@eof || !@buffer.empty? parse_tag end end |
Instance Attribute Details
#eles ⇒ Object (readonly)
An array that holds all the parsed root-elements.
8 9 10 |
# File 'lib/html_gen/parser.rb', line 8 def eles @eles end |