Class: Gammo::CSSSelector::NodeSet
- Inherits:
-
Object
- Object
- Gammo::CSSSelector::NodeSet
- 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
-
#disjoint ⇒ Object
Returns the value of attribute disjoint.
-
#nodes ⇒ Object
readonly
Returns the value of attribute nodes.
Instance Method Summary collapse
- #+(other) ⇒ Object
-
#initialize ⇒ Gammo::CSSSelector::NodeSet
constructor
Constructs a new instance of Gammo::CSSSelector::NodeSet.
Constructor Details
#initialize ⇒ Gammo::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
#disjoint ⇒ Object
Returns the value of attribute disjoint.
15 16 17 |
# File 'lib/gammo/css_selector/node_set.rb', line 15 def disjoint @disjoint end |
#nodes ⇒ Object (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 |