Class: ReverseTunnel::Message::Data

Inherits:
ReverseTunnel::Message show all
Defined in:
lib/reverse-tunnel/message.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from ReverseTunnel::Message

create, #pack, #type, type, type_id, #type_id, types, unpack

Constructor Details

#initialize(session_id = nil, data = nil) ⇒ Data

Returns a new instance of Data.



75
76
77
78
# File 'lib/reverse-tunnel/message.rb', line 75

def initialize(session_id = nil, data = nil)
  self.session_id = session_id
  self.data = data
end

Instance Attribute Details

#dataObject

Returns the value of attribute data.



73
74
75
# File 'lib/reverse-tunnel/message.rb', line 73

def data
  @data
end

#session_idObject

Returns the value of attribute session_id.



73
74
75
# File 'lib/reverse-tunnel/message.rb', line 73

def session_id
  @session_id
end

Instance Method Details

#load(payload) ⇒ Object



84
85
86
# File 'lib/reverse-tunnel/message.rb', line 84

def load(payload)
  self.session_id, self.data = payload
end

#payloadObject



80
81
82
# File 'lib/reverse-tunnel/message.rb', line 80

def payload
  [session_id, data]
end