Class: RexleParser
- Inherits:
-
Object
- Object
- RexleParser
- Defined in:
- lib/rexleparser.rb
Overview
file: rexleparser.rb description: used by rexle.rb
Instance Attribute Summary collapse
-
#doctype ⇒ Object
readonly
Returns the value of attribute doctype.
-
#instructions ⇒ Object
readonly
Returns the value of attribute instructions.
-
#to_a ⇒ Object
readonly
Returns the value of attribute to_a.
Instance Method Summary collapse
-
#initialize(raw_s) ⇒ RexleParser
constructor
A new instance of RexleParser.
Constructor Details
#initialize(raw_s) ⇒ RexleParser
Returns a new instance of RexleParser.
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/rexleparser.rb', line 10 def initialize(raw_s) super() s = raw_s.clone @instructions = s.scan(/<\?([\w-]+) ([^>]+)\?>/) @doctype = s.slice!(/<!DOCTYPE html>\n?/) @to_a = reverse(parse_node(s.strip.gsub(/<\?[^>]+>/,'').reverse)) end |
Instance Attribute Details
#doctype ⇒ Object (readonly)
Returns the value of attribute doctype.
8 9 10 |
# File 'lib/rexleparser.rb', line 8 def doctype @doctype end |
#instructions ⇒ Object (readonly)
Returns the value of attribute instructions.
8 9 10 |
# File 'lib/rexleparser.rb', line 8 def instructions @instructions end |
#to_a ⇒ Object (readonly)
Returns the value of attribute to_a.
8 9 10 |
# File 'lib/rexleparser.rb', line 8 def to_a @to_a end |