Class: GroupedControllers
- 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
- #clear ⇒ Object
- #get ⇒ Object
-
#initialize(name) ⇒ GroupedControllers
constructor
A new instance of GroupedControllers.
- #set(controller) ⇒ Object
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
#clear ⇒ Object
18 19 20 |
# File 'lib/volt/page/bindings/template_binding/grouped_controllers.rb', line 18 def clear @@controllers.delete(@name) end |
#get ⇒ Object
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 |