Class: Pragma::Filter::Scope

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

Instance Attribute Summary collapse

Attributes inherited from Base

#param

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of Scope.



8
9
10
11
# File 'lib/pragma/filter/scope.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/scope.rb', line 6

def scope
  @scope
end

Instance Method Details

#apply(relation:, value:) ⇒ Object



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

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