Class: TFW::State
Overview
Singleton class to keep the stack
Instance Method Summary collapse
-
#initialize ⇒ State
constructor
A new instance of State.
- #reset ⇒ Object
- #stack(&block) ⇒ Object
Constructor Details
#initialize ⇒ State
Returns a new instance of State.
8 9 10 |
# File 'lib/tfw/state.rb', line 8 def initialize @stack = TFDSL::Stack.new end |
Instance Method Details
#reset ⇒ Object
17 18 19 |
# File 'lib/tfw/state.rb', line 17 def reset @stack = TFDSL::Stack.new end |
#stack(&block) ⇒ Object
12 13 14 15 |
# File 'lib/tfw/state.rb', line 12 def stack(&block) @stack.instance_eval(&block) if block_given? @stack end |