Class: Sawtooth::Document::Stack
- Inherits:
-
Array
- Object
- Array
- Sawtooth::Document::Stack
- Defined in:
- lib/sawtooth/document.rb
Instance Method Summary collapse
Instance Method Details
#current ⇒ Object Also known as: top
22 |
# File 'lib/sawtooth/document.rb', line 22 def current; peek(0) end |
#parent ⇒ Object
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 |
#root ⇒ Object
27 |
# File 'lib/sawtooth/document.rb', line 27 def root; first end |