class PactBroker::FeatureToggle
Public Class Methods
enabled?(feature, ignore_env)
click to toggle source
# File lib/pact_broker/feature_toggle.rb, line 5 def self.enabled?(feature, ignore_env) if ignore_env feature_in_env_var?(feature) else not_production? || feature_in_env_var?(feature) end end
feature_in_env_var?(feature)
click to toggle source
# File lib/pact_broker/feature_toggle.rb, line 17 def self.feature_in_env_var?(feature) PactBroker.configuration.features[feature.to_s.downcase.to_sym] == true end
not_production?()
click to toggle source
# File lib/pact_broker/feature_toggle.rb, line 13 def self.not_production? ENV["RACK_ENV"] != "production" end