2018-12-13 13:39:08 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-11-08 19:23:39 +05:30
|
|
|
module Constraints
|
|
|
|
class FeatureConstrainer
|
2019-02-15 15:39:39 +05:30
|
|
|
attr_reader :args
|
2018-11-08 19:23:39 +05:30
|
|
|
|
2019-02-15 15:39:39 +05:30
|
|
|
def initialize(*args)
|
|
|
|
@args = args
|
2018-11-08 19:23:39 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
def matches?(_request)
|
2019-02-15 15:39:39 +05:30
|
|
|
Feature.enabled?(*args)
|
2018-11-08 19:23:39 +05:30
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|