Class: MDOM::InlineParser::Scanner
- Inherits:
-
Object
- Object
- MDOM::InlineParser::Scanner
- Defined in:
- lib/mdom/inline_parser.rb
Instance Method Summary collapse
-
#initialize(text) ⇒ Scanner
constructor
A new instance of Scanner.
- #read_nodes ⇒ Object
Constructor Details
#initialize(text) ⇒ Scanner
Returns a new instance of Scanner.
22 23 24 25 26 |
# File 'lib/mdom/inline_parser.rb', line 22 def initialize(text) @text = text @len = text.length @pos = 0 end |
Instance Method Details
#read_nodes ⇒ Object
28 29 30 31 32 33 34 35 |
# File 'lib/mdom/inline_parser.rb', line 28 def read_nodes nodes = [] while @pos < @len node = read_node nodes << node if node end nodes end |