Class: Node

Inherits:
Object
  • Object
show all
Defined in:
lib/controller/node.rb

Overview

Class that represents a Controller device.

Direct Known Subclasses

NetconfNode, OpenflowNode

Instance Attribute Summary collapse

Instance Method Summary collapse

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

Raises:

  • (ArgumentError)


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

#nameObject (readonly)

String : The name of the node. e.g. vrouter



36
37
38
# File 'lib/controller/node.rb', line 36

def name
  @name
end