Class: Node
- Inherits:
-
Object
- Object
- Node
- Defined in:
- lib/controller/node.rb
Overview
Class that represents a Controller device.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
String : The name of the node.
Instance Method Summary collapse
-
#initialize(controller: nil, name: nil) ⇒ Node
constructor
- Parameters *
controller -
Controller : The controller object through which node is to be accessed.
- Parameters *
Constructor Details
#initialize(controller: nil, name: nil) ⇒ Node
Parameters
controller-
Controller : The controller object through which node is to be accessed.
name-
String : The name of the node. e.g. vrouter
41 42 43 44 45 46 47 |
# File 'lib/controller/node.rb', line 41 def initialize(controller: nil, name: nil) raise ArgumentError, "Controller (controller) required" unless controller raise ArgumentError, "Name (name) required" unless name raise ArgumentError, "Controller (controller) must be instance of 'Controller'" unless controller.is_a?(Controller) @controller = controller @name = name end |
Instance Attribute Details
#name ⇒ Object (readonly)
String : The name of the node. e.g. vrouter
36 37 38 |
# File 'lib/controller/node.rb', line 36 def name @name end |