Class: Node
- Inherits:
-
Object
- Object
- Node
- Defined in:
- lib/nutrientes/list.rb
Overview
Class Node Defines the container of each element of the list
Constant Summary collapse
- @@estructura =
Struct.new(:value, :next_, :prev_)
Instance Attribute Summary collapse
-
#nodo ⇒ Object
readonly
Returns the value of attribute nodo.
-
#r nodo(nodo) ⇒ Object
Class Node Defines the container of each element of the list.
Instance Method Summary collapse
-
#initialize(val) ⇒ Node
constructor
Initialization of a node.
Constructor Details
#initialize(val) ⇒ Node
Initialization of a node
18 19 20 |
# File 'lib/nutrientes/list.rb', line 18 def initialize(val) @nodo = @@estructura.new(val, nil, nil) end |
Instance Attribute Details
#nodo ⇒ Object (readonly)
Returns the value of attribute nodo.
14 15 16 |
# File 'lib/nutrientes/list.rb', line 14 def nodo @nodo end |
#r nodo(nodo) ⇒ Object
Class Node Defines the container of each element of the list
12 13 14 15 16 17 18 19 20 21 |
# File 'lib/nutrientes/list.rb', line 12 class Node @@estructura = Struct.new(:value, :next_, :prev_) attr_reader :nodo # Initialization of a node # @param val [Object] Value to store at the node def initialize(val) @nodo = @@estructura.new(val, nil, nil) end end |