Class: Gammo::CSSSelector::NodeSet

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/gammo/css_selector/node_set.rb

Overview

Class for representing node set Especially this class will be used for expressing the result of evaluation of a given CSS selector.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeGammo::CSSSelector::NodeSet

Constructs a new instance of Gammo::CSSSelector::NodeSet.



19
20
21
22
# File 'lib/gammo/css_selector/node_set.rb', line 19

def initialize
  @nodes    = []
  @disjoint = false
end

Instance Attribute Details

#disjointObject

Returns the value of attribute disjoint.



15
16
17
# File 'lib/gammo/css_selector/node_set.rb', line 15

def disjoint
  @disjoint
end

#nodesObject (readonly)

Returns the value of attribute nodes.



13
14
15
# File 'lib/gammo/css_selector/node_set.rb', line 13

def nodes
  @nodes
end

Instance Method Details

#+(other) ⇒ Object



32
33
34
35
36
# File 'lib/gammo/css_selector/node_set.rb', line 32

def +(other)
  ns = NodeSet.new
  ns.nodes.concat(@nodes | other.nodes)
  ns
end