Class: WsConnectionData

Inherits:
Object
  • Object
show all
Defined in:
lib/hypertube-ruby-sdk/utils/ws_connection_data.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hostname) ⇒ WsConnectionData

Returns a new instance of WsConnectionData.



6
7
8
# File 'lib/hypertube-ruby-sdk/utils/ws_connection_data.rb', line 6

def initialize(hostname)
  @hostname = hostname
end

Instance Attribute Details

#hostnameObject

Returns the value of attribute hostname.



4
5
6
# File 'lib/hypertube-ruby-sdk/utils/ws_connection_data.rb', line 4

def hostname
  @hostname
end

Instance Method Details

#==(other) ⇒ Object



18
19
20
# File 'lib/hypertube-ruby-sdk/utils/ws_connection_data.rb', line 18

def ==(other)
  other.is_a?(WsConnectionData) && @hostname == other.hostname
end

#connection_typeObject



10
11
12
# File 'lib/hypertube-ruby-sdk/utils/ws_connection_data.rb', line 10

def connection_type
  ConnectionType::WEB_SOCKET
end

#serialize_connection_dataObject



14
15
16
# File 'lib/hypertube-ruby-sdk/utils/ws_connection_data.rb', line 14

def serialize_connection_data
  [connection_type, 0, 0, 0, 0, 0, 0]
end

#to_sObject



22
23
24
# File 'lib/hypertube-ruby-sdk/utils/ws_connection_data.rb', line 22

def to_s
  @hostname
end