Sha256: 7846845fbe5fae23d125a6b8d7bd7b3a2208b1bcacd7b84461d6a58197ba297d

Contents?: true

Size: 550 Bytes

Versions: 17

Compression:

Stored size: 550 Bytes

Contents

module Flip
  module Declarable

    def self.extended(base)
      FeatureSet.reset
    end

    # Adds a new feature definition, creates predicate method.
    def feature(key, options = {})
      FeatureSet.instance << Flip::Definition.new(key, options)
    end

    # Adds a strategy for determining feature status.
    def strategy(strategy)
      FeatureSet.instance.add_strategy strategy
    end

    # The default response, boolean or a Proc to be called.
    def default(default)
      FeatureSet.instance.default = default
    end

  end
end

Version data entries

17 entries across 17 versions & 3 rubygems

Version Path
flip2-1.1.3 lib/flip/declarable.rb
flip2-1.1.2 lib/flip/declarable.rb
flip2-1.1.1 lib/flip/declarable.rb
flip-1.1.0 lib/flip/declarable.rb
flip-1.0.1 lib/flip/declarable.rb
flip-1.0.0 lib/flip/declarable.rb
flip-0.2.1 lib/flip/declarable.rb
flip-0.2.0 lib/flip/declarable.rb
flip_fork-0.2.0 lib/flip/declarable.rb
flip_fork-0.1.1 lib/flip/declarable.rb
flip_fork-0.1.0 lib/flip/declarable.rb
flip-0.1.0 lib/flip/declarable.rb
flip-0.0.4 lib/flip/declarable.rb
flip-0.0.3 lib/flip/declarable.rb
flip-0.0.2 lib/flip/declarable.rb
flip-0.0.1 lib/flip/declarable.rb
flip-0.0.1.alpha2 lib/flip/declarable.rb