Class: Postspec::FrameStack

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(postspec) ⇒ FrameStack

Returns a new instance of FrameStack.



10
11
12
13
14
# File 'lib/postspec/frame.rb', line 10

def initialize(postspec)
  constrain postspec, Postspec
  @postspec = postspec
  @stack = []
end

Instance Attribute Details

#postspecObject (readonly)

Returns the value of attribute postspec.



7
8
9
# File 'lib/postspec/frame.rb', line 7

def postspec
  @postspec
end

Instance Method Details

#dumpObject



21
22
23
24
# File 'lib/postspec/frame.rb', line 21

def dump()
  puts self.class
  indent { @stack.reverse.map(&:dump) }
end

#popObject



19
# File 'lib/postspec/frame.rb', line 19

def pop() @stack.pop end

#push(frame) ⇒ Object



18
# File 'lib/postspec/frame.rb', line 18

def push(frame) @stack.push frame; frame end

#topObject



20
# File 'lib/postspec/frame.rb', line 20

def top() @stack.last end