Class: GorgonAMQ::Protocol::Connection::Tune

Inherits:
Method
  • Object
show all
Defined in:
lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Method

encode_body, index, inherited, instantiate, method_id, methods, name, split_headers

Constructor Details

#initialize(channel_max, frame_max, heartbeat) ⇒ Tune

Returns a new instance of Tune.



340
341
342
343
344
# File 'lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb', line 340

def initialize(channel_max, frame_max, heartbeat)
  @channel_max = channel_max
  @frame_max = frame_max
  @heartbeat = heartbeat
end

Instance Attribute Details

#channel_maxObject (readonly)

Returns the value of attribute channel_max.



339
340
341
# File 'lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb', line 339

def channel_max
  @channel_max
end

#frame_maxObject (readonly)

Returns the value of attribute frame_max.



339
340
341
# File 'lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb', line 339

def frame_max
  @frame_max
end

#heartbeatObject (readonly)

Returns the value of attribute heartbeat.



339
340
341
# File 'lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb', line 339

def heartbeat
  @heartbeat
end

Class Method Details

.decode(data) ⇒ Object

Returns:



328
329
330
331
332
333
334
335
336
337
# File 'lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb', line 328

def self.decode(data)
  offset = 0
  channel_max = data[offset, 2].unpack(PACK_UINT16).first
  offset += 2
  frame_max = data[offset, 4].unpack(PACK_UINT32).first
  offset += 4
  heartbeat = data[offset, 2].unpack(PACK_UINT16).first
  offset += 2
  self.new(channel_max, frame_max, heartbeat)
end

.has_content?Boolean

Returns:

  • (Boolean)


346
347
348
# File 'lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb', line 346

def self.has_content?
  false
end