Sha256: b315550edad9e51c553e114ff1cf23f30fe679332301f07d9cd38e0cb74d9a4a

Contents?: true

Size: 497 Bytes

Versions: 7

Compression:

Stored size: 497 Bytes

Contents

require 'artoo/robot'

class HelloRobot < Artoo::Robot
	connection :loopback1
	connection :loopback2
	connection :loopback3
	device :passthru1
	device :passthru2
	device :pinger, :driver => :pinger
	device :pinger2, :driver => :pinger2

	api :host => '127.0.0.1', :port => '8080'

	work do
		puts "Hello from '#{name}' attached to API running at #{api_host}:#{api_port}..."
	end
end

robots = []
5.times do |i|
	robots << HelloRobot.new(:name => "Number #{i}")
end

HelloRobot.work!(robots)
sleep

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
artoo-0.5.0 examples/hello_api_multiple.rb
artoo-0.4.1 examples/hello_api_multiple.rb
artoo-0.4.0 examples/hello_api_multiple.rb
artoo-0.3.0 examples/hello_api_multiple.rb
artoo-0.2.0 examples/hello_api_multiple.rb
artoo-0.1.3 examples/hello_api_multiple.rb
artoo-0.1.2 examples/hello_api_multiple.rb