module FlipFlop
Constants
- VERSION
Public Class Methods
configure(&block)
click to toggle source
Initialize and configure FlipFlop
for use
Example:
>> FlipFlop::configure { |config| config[:adapter] = FlipFlop::Adapters::Memory }
Arguments:
configuration block: (block)
# File lib/flip-flop.rb, line 24 def self.configure(&block) @flip_flop = FlipFlop.new @flip_flop.configure(&block) end
feature_enabled?(feature_name, actor=nil)
click to toggle source
Check if a feature is enabled or not
Example:
>> puts "hello" if FlipFlop::feature_enabled? :say_hello
Arguments:
feature_name (String/Symbol)
# File lib/flip-flop.rb, line 36 def self.feature_enabled?(feature_name, actor=nil) get_instance.feature_enabled? feature_name.to_sym, actor end
get_instance()
click to toggle source
Get the instnace of FlipFlop
or initialize a new one.
Example:
>> FlipFlop::get_intance => <FlipFlop::FlipFlop>
# File lib/flip-flop.rb, line 13 def self.get_instance @flip_flop ||= FlipFlop.new end