Class: VCDOM::NodeList

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/vcdom/node_list.rb

Instance Method Summary collapse

Constructor Details

#initialize(nodes) ⇒ NodeList

Returns a new instance of NodeList.



10
11
12
# File 'lib/vcdom/node_list.rb', line 10

def initialize( nodes )
  @nodes = nodes
end

Instance Method Details

#eachObject



19
20
21
22
23
# File 'lib/vcdom/node_list.rb', line 19

def each
  @nodes.each do |n|
    yield n
  end
end

#inspectObject



25
26
27
# File 'lib/vcdom/node_list.rb', line 25

def inspect
  "#<VCXML::DOM::NodeList>"
end

#item(index) ⇒ Object



13
14
15
# File 'lib/vcdom/node_list.rb', line 13

def item( index )
  @nodes[index]
end

#lengthObject



16
17
18
# File 'lib/vcdom/node_list.rb', line 16

def length
  @nodes.length
end