Module: Rea::Settings::ClassMethods
- Defined in:
- lib/rea/settings.rb
Instance Method Summary collapse
Instance Method Details
#default_settings ⇒ Object
52 53 54 |
# File 'lib/rea/settings.rb', line 52 def default_settings @default_settings ||= {} end |
#setting(name, default) ⇒ Object
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/rea/settings.rb', line 35 def setting(name, default) default_settings[name] = default attr_accessor(name) # Create an accessor that grabs from the defaults # if @name has not been set yet class_eval " def \#{name}\n if instance_variable_defined? :@\#{name}\n @\#{name}\n else\n read_default_setting(:\#{name})\n end\n end\n EOC\nend\n", __FILE__, __LINE__ + 1 |