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



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

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



9
10
11
# File 'lib/flipflop/facade.rb', line 9

def feature_set
  FeatureSet.current
end

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

Returns:

  • (Boolean)


13
14
15
# File 'lib/flipflop/facade.rb', line 13

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