Class: Cybertrain::WebSocket::Status

Inherits:
Object
  • Object
show all
Defined in:
cybertrain/websocket.rb

Overview

A snapshot of a subscription’s state, from feed_status.

Instance Method Summary collapse

Instance Method Details

#connected? ⇒ Boolean

Returns whether the feed is connected now.

Returns:

  • (Boolean) —

    whether the feed is connected now



112
113
114
# File 'cybertrain/websocket.rb', line 112

def connected?
  @connected
end

#last_message_at ⇒ Integer

Returns epoch seconds of the last message, 0 for none yet.

Returns:

  • (Integer) —

    epoch seconds of the last message, 0 for none yet



118
119
120
# File 'cybertrain/websocket.rb', line 118

def last_message_at
  @last_message_at
end

#reconnects ⇒ Integer

Returns how many times the feed connected again after its first connection.

Returns:

  • (Integer) —

    how many times the feed connected again after its first connection



125
126
127
# File 'cybertrain/websocket.rb', line 125

def reconnects
  @reconnects
end