Module: HatiConfig::Cache::NumericConfigurable::ClassMethods
- Defined in:
- lib/hati_config/cache.rb
Instance Method Summary collapse
Instance Method Details
#numeric_accessor(*names) ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/hati_config/cache.rb', line 17 def numeric_accessor(*names) names.each do |name| define_method(name) do |value = nil| if value.nil? instance_variable_get(:"@#{name}") else instance_variable_set(:"@#{name}", value) self end end end end |