class FlipFab::Feature

Attributes

default[R]
name[R]
persistence_adapters[R]

Public Class Methods

new(name, options = {}) click to toggle source
# File lib/flip_fab/feature.rb, line 5
def initialize(name, options = {})
  @name                 = name
  @default              = options[:default] || :disabled
  @persistence_adapters = options[:persistence_adapters] || [CookiePersistence]
end

Public Instance Methods

disabled?() click to toggle source
# File lib/flip_fab/feature.rb, line 15
def disabled?
  !enabled?
end
enabled?() click to toggle source
# File lib/flip_fab/feature.rb, line 11
def enabled?
  default == :enabled
end
with_context(context) click to toggle source
# File lib/flip_fab/feature.rb, line 19
def with_context(context)
  ContextualFeature.new self, context
end