Class: RexleParser

Inherits:
Object
  • Object
show all
Defined in:
lib/rexleparser.rb

Overview

file: rexleparser.rb description: used by rexle.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#doctypeObject (readonly)

Returns the value of attribute doctype.



8
9
10
# File 'lib/rexleparser.rb', line 8

def doctype
  @doctype
end

#instructionsObject (readonly)

Returns the value of attribute instructions.



8
9
10
# File 'lib/rexleparser.rb', line 8

def instructions
  @instructions
end

#to_aObject (readonly)

Returns the value of attribute to_a.



8
9
10
# File 'lib/rexleparser.rb', line 8

def to_a
  @to_a
end