Class: TFW::State

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/tfw/state.rb

Overview

Singleton class to keep the stack

Instance Method Summary collapse

Constructor Details

#initializeState

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

#resetObject



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