Class: KQL::Selector::Combined

Inherits:
KQL::Selector show all
Defined in:
lib/kql/selector.rb

Instance Attribute Summary collapse

Attributes inherited from KQL::Selector

#filter

Instance Method Summary collapse

Constructor Details

#initialize(filter, combinator, selector) ⇒ Combined

Returns a new instance of Combined.



22
23
24
25
26
# File 'lib/kql/selector.rb', line 22

def initialize(filter, combinator, selector)
  super(filter)
  @combinator = combinator
  @selector = selector
end

Instance Attribute Details

#combinatorObject (readonly)

Returns the value of attribute combinator.



20
21
22
# File 'lib/kql/selector.rb', line 20

def combinator
  @combinator
end

#selectorObject (readonly)

Returns the value of attribute selector.



20
21
22
# File 'lib/kql/selector.rb', line 20

def selector
  @selector
end

Instance Method Details

#==(other) ⇒ Object



28
29
30
31
32
33
34
# File 'lib/kql/selector.rb', line 28

def ==(other)
  return false unless other.is_a?(Combined)

  other.filter == filter &&
    other.combinator == combinator &&
    other.selector == selector
end

#execute(context) ⇒ Object



36
37
38
# File 'lib/kql/selector.rb', line 36

def execute(context)
  combinator.execute(super, selector)
end