Class: Detour::Configuration
- Inherits:
-
Object
- Object
- Detour::Configuration
- Defined in:
- lib/detour/configuration.rb
Instance Attribute Summary collapse
-
#defined_groups ⇒ Object
readonly
Returns the value of attribute defined_groups.
-
#feature_search_dirs ⇒ Object
Returns the value of attribute feature_search_dirs.
-
#feature_search_regex ⇒ Object
Returns the value of attribute feature_search_regex.
-
#flaggable_types ⇒ Object
Returns the value of attribute flaggable_types.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
-
#method_missing(method, *args, &block) ⇒ Object
Allows for methods of the form ‘define_user_group` that call the private method `define_group_for_class`.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
7 8 9 10 11 |
# File 'lib/detour/configuration.rb', line 7 def initialize @defined_groups = {} @flaggable_types = [] @feature_search_dirs = [] end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args, &block) ⇒ Object
Allows for methods of the form ‘define_user_group` that call the private method `define_group_for_class`. A new group for any `User` records will be created that rollouts can be attached to.
36 37 38 39 40 41 42 |
# File 'lib/detour/configuration.rb', line 36 def method_missing(method, *args, &block) if /^define_(?<klass>[a-z0-9_]+)_group/ =~ method define_group_for_class(klass.classify, args[0], &block) else super end end |
Instance Attribute Details
#defined_groups ⇒ Object (readonly)
Returns the value of attribute defined_groups.
2 3 4 |
# File 'lib/detour/configuration.rb', line 2 def defined_groups @defined_groups end |
#feature_search_dirs ⇒ Object
Returns the value of attribute feature_search_dirs.
5 6 7 |
# File 'lib/detour/configuration.rb', line 5 def feature_search_dirs @feature_search_dirs end |
#feature_search_regex ⇒ Object
Returns the value of attribute feature_search_regex.
3 4 5 |
# File 'lib/detour/configuration.rb', line 3 def feature_search_regex @feature_search_regex end |
#flaggable_types ⇒ Object
Returns the value of attribute flaggable_types.
4 5 6 |
# File 'lib/detour/configuration.rb', line 4 def flaggable_types @flaggable_types end |