Class: AMQ::Protocol::Connection::Start

Inherits:
Method
  • Object
show all
Defined in:
lib/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(version_major, version_minor, server_properties, mechanisms, locales) ⇒ Start

Returns a new instance of Start.



325
326
327
328
329
330
331
# File 'lib/amq/protocol/client.rb', line 325

def initialize(version_major, version_minor, server_properties, mechanisms, locales)
  @version_major = version_major
  @version_minor = version_minor
  @server_properties = server_properties
  @mechanisms = mechanisms
  @locales = locales
end

Instance Attribute Details

#localesObject (readonly)

Returns the value of attribute locales.



324
325
326
# File 'lib/amq/protocol/client.rb', line 324

def locales
  @locales
end

#mechanismsObject (readonly)

Returns the value of attribute mechanisms.



324
325
326
# File 'lib/amq/protocol/client.rb', line 324

def mechanisms
  @mechanisms
end

#server_propertiesObject (readonly)

Returns the value of attribute server_properties.



324
325
326
# File 'lib/amq/protocol/client.rb', line 324

def server_properties
  @server_properties
end

#version_majorObject (readonly)

Returns the value of attribute version_major.



324
325
326
# File 'lib/amq/protocol/client.rb', line 324

def version_major
  @version_major
end

#version_minorObject (readonly)

Returns the value of attribute version_minor.



324
325
326
# File 'lib/amq/protocol/client.rb', line 324

def version_minor
  @version_minor
end

Class Method Details

.decode(data) ⇒ Object

Returns:



304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
# File 'lib/amq/protocol/client.rb', line 304

def self.decode(data)
  offset = 0
  version_major = data[offset, 1].unpack(PACK_CHAR).first
  offset += 1
  version_minor = data[offset, 1].unpack(PACK_CHAR).first
  offset += 1
  table_length = Table.length(data[offset, 4])
  server_properties = Table.decode(data[offset, table_length + 4])
  offset += table_length + 4
  length = data[offset, 4].unpack(PACK_UINT32).first
  offset += 4
  mechanisms = data[offset, length]
  offset += length
  length = data[offset, 4].unpack(PACK_UINT32).first
  offset += 4
  locales = data[offset, length]
  offset += length
  self.new(version_major, version_minor, server_properties, mechanisms, locales)
end

.has_content?Boolean

Returns:

  • (Boolean)


333
334
335
# File 'lib/amq/protocol/client.rb', line 333

def self.has_content?
  false
end