Class: Sawtooth::Document::Stack

Inherits:
Array
  • Object
show all
Defined in:
lib/sawtooth/document.rb

Instance Method Summary collapse

Instance Method Details

#currentObject Also known as: top



22
# File 'lib/sawtooth/document.rb', line 22

def current; peek(0) end

#parentObject



25
# File 'lib/sawtooth/document.rb', line 25

def parent; peek(-1) end

#peek(n = 0) ⇒ Object



18
19
20
# File 'lib/sawtooth/document.rb', line 18

def peek(n = 0)
  self[(n + 1) * -1]
end

#rootObject



27
# File 'lib/sawtooth/document.rb', line 27

def root; first end