Class: Node
- Inherits:
-
Object
- Object
- Node
- Defined in:
- lib/rgraph/node.rb
Instance Attribute Summary collapse
-
#neighbours ⇒ Object
Returns the value of attribute neighbours.
Instance Method Summary collapse
-
#initialize(arg) ⇒ Node
constructor
A new instance of Node.
- #method_missing(name, *args) ⇒ Object
Constructor Details
#initialize(arg) ⇒ Node
Returns a new instance of Node.
3 4 5 6 |
# File 'lib/rgraph/node.rb', line 3 def initialize(arg) @args = arg @neighbours = [] end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args) ⇒ Object
8 9 10 11 |
# File 'lib/rgraph/node.rb', line 8 def method_missing(name, *args) super unless args.empty? @args[name] end |
Instance Attribute Details
#neighbours ⇒ Object
Returns the value of attribute neighbours.
2 3 4 |
# File 'lib/rgraph/node.rb', line 2 def neighbours @neighbours end |