Class: Chromecast::Channel::Heartbeat

Inherits:
Base
  • Object
show all
Defined in:
lib/chromecast/channel/heartbeat.rb

Constant Summary collapse

NAMESPACE =
'urn:x-cast:com.google.cast.tp.heartbeat'

Instance Attribute Summary

Attributes inherited from Base

#connection, #namespace, #type

Instance Method Summary collapse

Methods inherited from Base

#send

Constructor Details

#initialize(connection) ⇒ Heartbeat

Returns a new instance of Heartbeat.



6
7
8
# File 'lib/chromecast/channel/heartbeat.rb', line 6

def initialize connection
  super(connection, NAMESPACE, :json)
end

Instance Method Details

#pingObject



10
11
12
# File 'lib/chromecast/channel/heartbeat.rb', line 10

def ping
  send(type: 'PING')
end

#pongObject



14
15
16
# File 'lib/chromecast/channel/heartbeat.rb', line 14

def pong
  send(type: 'PONG')
end