Class: HTML5::TreeWalkers::Base

Inherits:
Object
  • Object
show all
Includes:
TokenConstructor
Defined in:
lib/html5/treewalkers/base.rb

Instance Method Summary collapse

Methods included from TokenConstructor

#_, #comment, #doctype, #empty_tag, #end_tag, #error, #normalize_attrs, #start_tag, #text, #unknown

Constructor Details

#initialize(tree) ⇒ Base

Returns a new instance of Base.



62
63
64
# File 'lib/html5/treewalkers/base.rb', line 62

def initialize(tree)
  @tree = tree
end

Instance Method Details

#eachObject Also known as: walk

Raises:

  • (NotImplementedError)


66
67
68
# File 'lib/html5/treewalkers/base.rb', line 66

def each
  raise NotImplementedError
end

#to_aryObject



72
73
74
75
76
77
78
# File 'lib/html5/treewalkers/base.rb', line 72

def to_ary
  a = []
  each do |i|
    a << i
  end
  a
end