Class: Alimento::Nodo

Inherits:
Struct
  • Object
show all
Defined in:
lib/alimento/dll.rb,
lib/alimento/dll.rb

Overview

Clase nodo, almacena un valor y apunta al nodo anterior y al siguiente. Es necesaria para la clase Dll

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#nextObject

Returns the value of attribute next

Returns:

  • (Object)

    the current value of next



5
6
7
# File 'lib/alimento/dll.rb', line 5

def next
  @next
end

#prevObject

Returns the value of attribute prev

Returns:

  • (Object)

    the current value of prev



5
6
7
# File 'lib/alimento/dll.rb', line 5

def prev
  @prev
end

#valueObject

Returns the value of attribute value

Returns:

  • (Object)

    the current value of value



5
6
7
# File 'lib/alimento/dll.rb', line 5

def value
  @value
end

Instance Method Details

#to_sObject

Operador de salida de la clase nodo. Imprime únicamente el valor del nodo



8
9
10
# File 'lib/alimento/dll.rb', line 8

def to_s
  value.to_s
end