Class: GroupedControllers

Inherits:
Object show all
Defined in:
lib/volt/page/bindings/template_binding/grouped_controllers.rb

Overview

Some template bindings share the controller with other template bindings based on a name. This class stores those and provides helper methods to clear/set/get.

Constant Summary collapse

@@controllers =
{}

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ GroupedControllers

Returns a new instance of GroupedControllers.



6
7
8
# File 'lib/volt/page/bindings/template_binding/grouped_controllers.rb', line 6

def initialize(name)
  @name = name
end

Instance Method Details

#clearObject



18
19
20
# File 'lib/volt/page/bindings/template_binding/grouped_controllers.rb', line 18

def clear
  @@controllers.delete(@name)
end

#getObject



10
11
12
# File 'lib/volt/page/bindings/template_binding/grouped_controllers.rb', line 10

def get
  @@controllers[@name]
end

#set(controller) ⇒ Object



14
15
16
# File 'lib/volt/page/bindings/template_binding/grouped_controllers.rb', line 14

def set(controller)
  @@controllers[@name] = controller
end