Class: UseContext::ContextStack

Inherits:
Object
  • Object
show all
Defined in:
lib/use_context.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeContextStack

Returns a new instance of ContextStack.



45
46
47
48
# File 'lib/use_context.rb', line 45

def initialize
  @stack = []
  @context = Context.new(@stack)
end

Instance Attribute Details

#contextObject (readonly)

Returns the value of attribute context.



43
44
45
# File 'lib/use_context.rb', line 43

def context
  @context
end

Instance Method Details

#popObject



54
55
56
# File 'lib/use_context.rb', line 54

def pop
  @stack.pop
end

#push(context_hash) ⇒ Object



50
51
52
# File 'lib/use_context.rb', line 50

def push(context_hash)
  @stack << context_hash
end