Class: Hive::Controller::Shell

Inherits:
Hive::Controller show all
Defined in:
lib/hive/controller/shell.rb

Overview

The Shell controller

Instance Attribute Summary

Attributes inherited from Hive::Controller

#port_range_size

Instance Method Summary collapse

Methods inherited from Hive::Controller

#create_device

Constructor Details

#initialize(options) ⇒ Shell

Returns a new instance of Shell.



8
9
10
11
12
# File 'lib/hive/controller/shell.rb', line 8

def initialize(options)
  Hive.logger.debug("options: #{options.inspect}")
  @workers = options['workers'] || 0
  super
end

Instance Method Details

#detectObject



14
15
16
17
18
19
20
# File 'lib/hive/controller/shell.rb', line 14

def detect
  Hive.logger.info('Creating shell devices')
  (1..@workers).collect do |i|
    Hive.logger.info("  Shell device #{i}")
    self.create_device('id' => i)
  end
end