Class: Artoo::Drivers::Ping

Inherits:
Driver
  • Object
show all
Defined in:
lib/artoo/drivers/ping.rb

Overview

Test driver that can be pinged itself

Constant Summary collapse

COMMANDS =
[:ping].freeze

Instance Attribute Summary

Attributes inherited from Driver

#additional_params, #parent

Instance Method Summary collapse

Methods inherited from Driver

#command, #commands, #connection, #event_topic_name, #initialize, #interval, #known_command?, #method_missing, #pin, #require_interface

Constructor Details

This class inherits a constructor from Artoo::Drivers::Driver

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Artoo::Drivers::Driver

Instance Method Details

#pingObject

Publishes events to update event topic when pinged



16
17
18
19
20
21
22
# File 'lib/artoo/drivers/ping.rb', line 16

def ping
  data = 'pong'
  publish(event_topic_name("update"), "ping", data)
  publish(event_topic_name("ping"), data)

  data
end

#start_driverObject



10
11
12
# File 'lib/artoo/drivers/ping.rb', line 10

def start_driver
  super
end