Class: Templator::DslContext
- Inherits:
-
Object
- Object
- Templator::DslContext
- Defined in:
- lib/templator/parameter_dsl.rb
Overview
Context used by the DSL methods to retrieve and update the current group.
Class Method Summary collapse
-
.current_group ⇒ Group
Retrieve the current group from the context.
-
.enter_group(group) ⇒ Object
Enter a new group.
-
.leave_group ⇒ Object
Leave a group.
-
.top_level_group ⇒ Group
Retrieve the top level group from the context.
Class Method Details
.current_group ⇒ Group
Retrieve the current group from the context
116 117 118 |
# File 'lib/templator/parameter_dsl.rb', line 116 def self.current_group group_stack.last end |
.enter_group(group) ⇒ Object
Enter a new group. This method shall be called by the DSL methods whenever a new group is entered.
130 131 132 |
# File 'lib/templator/parameter_dsl.rb', line 130 def self.enter_group(group) group_stack.push(group) end |
.leave_group ⇒ Object
Leave a group. This method shall be calles by the DSL methods whenever a group is left.
137 138 139 |
# File 'lib/templator/parameter_dsl.rb', line 137 def self.leave_group group_stack.pop end |
.top_level_group ⇒ Group
Retrieve the top level group from the context
122 123 124 |
# File 'lib/templator/parameter_dsl.rb', line 122 def self.top_level_group group_stack.first end |