Module: FeatureSettings
- Defined in:
- lib/FlagsToggle/feature_settings.rb
Class Method Summary collapse
- .configure {|_self| ... } ⇒ Object
- .get_attributes ⇒ Object
- .method_missing(m, *args, &block) ⇒ Object
Class Method Details
.configure {|_self| ... } ⇒ Object
5 6 7 |
# File 'lib/FlagsToggle/feature_settings.rb', line 5 def configure yield(self) end |
.get_attributes ⇒ Object
19 20 21 22 23 24 25 26 27 28 |
# File 'lib/FlagsToggle/feature_settings.rb', line 19 def get_attributes attrs = Hash.new instance_variables.each do |var| str = var.to_s.gsub /^@/, '' if respond_to? "#{str}=" attrs[str.to_sym] = instance_variable_get var end end attrs end |
.method_missing(m, *args, &block) ⇒ Object
9 10 11 12 13 14 15 16 17 |
# File 'lib/FlagsToggle/feature_settings.rb', line 9 def method_missing(m, *args, &block) name = m.to_s aname = name.sub("=","") self.class.module_eval do attr_accessor aname end send name, args.first unless aname == name end |