Module: Happy::Controller::Configurable

Included in:
Happy::Controller
Defined in:
lib/happy/controller/configurable.rb

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object


4
5
6
# File 'lib/happy/controller/configurable.rb', line 4

def self.included(base)
  base.extend ClassMethods
end

Instance Method Details

#set(k, v) ⇒ Object

Change a setting on this controller instance.


16
17
18
# File 'lib/happy/controller/configurable.rb', line 16

def set(k, v)
  settings[k.to_sym] = v
end

#settingsObject

Return a hash containing this controller instance's settings.


10
11
12
# File 'lib/happy/controller/configurable.rb', line 10

def settings
  @settings ||= (self.class.settings.nil? ? {} : self.class.settings.dup)
end