Class: Constraints::FeatureConstrainer

Inherits:
Object
  • Object
show all
Defined in:
lib/constraints/feature_constrainer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ FeatureConstrainer

Returns a new instance of FeatureConstrainer.


7
8
9
# File 'lib/constraints/feature_constrainer.rb', line 7

def initialize(*args)
  @args = args
end

Instance Attribute Details

#argsObject (readonly)

Returns the value of attribute args


5
6
7
# File 'lib/constraints/feature_constrainer.rb', line 5

def args
  @args
end

Instance Method Details

#matches?(_request) ⇒ Boolean

Returns:

  • (Boolean)

11
12
13
# File 'lib/constraints/feature_constrainer.rb', line 11

def matches?(_request)
  Feature.enabled?(*args)
end