uptech/togls

View on GitHub
lib/togls/null_toggle.rb

Summary

Maintainability
A
0 mins
Test Coverage
module Togls
  # Null Toggle
  #
  # The Null Toggle model is designed to be used as a response when there is no
  # toggle found when requested to be retreived through a Toggle Repository.
  class NullToggle < Togls::Toggle
    def initialize
      feature = Togls::Feature.new('null', 'the official null feature', Togls::TargetTypes::EITHER)
      super(feature)
    end

    def on
      self
    end

    def off
      self
    end
  end

  class RuleFeatureMismatchToggle < NullToggle; end
end