Class: PolySSH::NodeList
- Inherits:
-
Object
- Object
- PolySSH::NodeList
- Includes:
- Enumerable, Visitable
- Defined in:
- lib/polyssh/node.rb
Instance Method Summary collapse
- #<<(node) ⇒ Object
- #each ⇒ Object
-
#initialize ⇒ NodeList
constructor
A new instance of NodeList.
Methods included from Visitable
Constructor Details
#initialize ⇒ NodeList
Returns a new instance of NodeList.
16 17 18 19 |
# File 'lib/polyssh/node.rb', line 16 def initialize @head = nil @tail = nil end |
Instance Method Details
#<<(node) ⇒ Object
21 22 23 24 25 26 27 28 29 30 |
# File 'lib/polyssh/node.rb', line 21 def <<(node) if @head.nil? then @head = node @tail = node else @tail.next = node @tail = node end self end |
#each ⇒ Object
8 9 10 11 12 13 14 |
# File 'lib/polyssh/node.rb', line 8 def each ptr = @head while not ptr.nil? do yield ptr ptr = ptr.next end end |