Class: Pragma::Filter::Boolean

Inherits:
Base
  • Object
show all
Defined in:
lib/pragma/filter/boolean.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#param

Instance Method Summary collapse

Constructor Details

#initialize(scope:, **other) ⇒ Boolean

Returns a new instance of Boolean.



8
9
10
11
# File 'lib/pragma/filter/boolean.rb', line 8

def initialize(scope:, **other)
  super(**other)
  @scope = scope
end

Instance Attribute Details

#scopeObject (readonly)

Returns the value of attribute scope.



6
7
8
# File 'lib/pragma/filter/boolean.rb', line 6

def scope
  @scope
end

Instance Method Details

#apply(relation:) ⇒ Object



13
14
15
# File 'lib/pragma/filter/boolean.rb', line 13

def apply(relation:, **)
  relation.public_send(scope)
end