Sha256: 0b87fffb12d922d43cef00c066969cc1956da98120442b5f4210eead099591c7

Contents?: true

Size: 336 Bytes

Versions: 10

Compression:

Stored size: 336 Bytes

Contents

# frozen_string_literal: true

module TFW
  # Singleton class to keep the stack
  class State
    include Singleton

    def initialize
      @stack = TFDSL::Stack.new
    end

    def stack(&block)
      @stack.instance_eval(&block) if block_given?
      @stack
    end

    def reset
      @stack = TFDSL::Stack.new
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
tfw-0.1.19 lib/tfw/state.rb
tfw-0.1.18 lib/tfw/state.rb
tfw-0.1.17 lib/tfw/state.rb
tfw-0.1.16 lib/tfw/state.rb
tfw-0.1.15 lib/tfw/state.rb
tfw-0.1.14 lib/tfw/state.rb
tfw-0.1.13 lib/tfw/state.rb
tfw-0.1.12 lib/tfw/state.rb
tfw-0.1.11 lib/tfw/state.rb
tfw-0.1.10 lib/tfw/state.rb