Module: Flipflop::Facade

Extended by:
Forwardable
Included in:
Flipflop
Defined in:
lib/flipflop/facade.rb

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args) ⇒ Object



15
16
17
18
19
20
21
# File 'lib/flipflop/facade.rb', line 15

def method_missing(method, *args)
  if method[-1] == "?"
    FeatureSet.current.enabled?(method[0..-2].to_sym)
  else
    super
  end
end

Instance Method Details

#feature_setObject



7
8
9
# File 'lib/flipflop/facade.rb', line 7

def feature_set
  FeatureSet.current
end

#respond_to_missing?(method, include_private = false) ⇒ Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/flipflop/facade.rb', line 11

def respond_to_missing?(method, include_private = false)
  method[-1] == "?"
end