class Rake::LinkedList::EmptyLinkedList

Represent an empty list, using the Null Object Pattern.

When inheriting from the LinkedList class, you should implement a type specific Empty class as well. Make sure you set the class instance variable @parent to the associated list class (this allows conj, cons and make to work polymorphically).

Public Class Methods

cons(head, tail) click to toggle source
# File rake-13.0.6/lib/rake/linked_list.rb, line 105
def self.cons(head, tail)
  @parent.cons(head, tail)
end
new() click to toggle source
# File rake-13.0.6/lib/rake/linked_list.rb, line 98
def initialize
end

Public Instance Methods

empty?() click to toggle source
# File rake-13.0.6/lib/rake/linked_list.rb, line 101
def empty?
  true
end