Module: Node_Double

Defined in:
lib/linkedlist/nodo_double.rb

Defined Under Namespace

Classes: Nodo_Double

Instance Method Summary collapse

Instance Method Details

#<=>(other) ⇒ Object



12
13
14
15
# File 'lib/linkedlist/nodo_double.rb', line 12

def <=>(other)
  return nil unless other.instance_of? Nodo_Double
  @val <=> other.val
end

#==(other) ⇒ Object



17
18
19
20
21
22
23
# File 'lib/linkedlist/nodo_double.rb', line 17

def ==(other)
  if other.is_a? Nodo_Double
    @val == other.val
  else
    false
  end
end