lib/happy/controller/configurable.rb in happy-0.1.0.pre25 vs lib/happy/controller/configurable.rb in happy-0.1.0.pre27
- old
+ new
@@ -1,24 +1,32 @@
module Happy
class Controller
module Configurable
extend ActiveSupport::Concern
- def options
- @options ||= self.class.options.dup
+ # Return a hash containing this controller instance's settings.
+ #
+ def settings
+ @settings ||= self.class.settings.dup
end
+ # Change a setting on this controller instance.
+ #
def set(k, v)
- options[k.to_sym] = v
+ settings[k.to_sym] = v
end
module ClassMethods
- def options
- @options ||= {}
+ # Return a hash containing this controller class' default settings.
+ #
+ def settings
+ @settings ||= {}
end
+ # Change a default setting on this controller class.
+ #
def set(k, v)
- options[k.to_sym] = v
+ settings[k.to_sym] = v
end
end
end
end
end