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.



227
228
229
230
231
232
233
# File 'lib/amq/protocol/client.rb', line 227

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.



226
227
228
# File 'lib/amq/protocol/client.rb', line 226

def locales
  @locales
end

#mechanismsObject (readonly)

Returns the value of attribute mechanisms.



226
227
228
# File 'lib/amq/protocol/client.rb', line 226

def mechanisms
  @mechanisms
end

#server_propertiesObject (readonly)

Returns the value of attribute server_properties.



226
227
228
# File 'lib/amq/protocol/client.rb', line 226

def server_properties
  @server_properties
end

#version_majorObject (readonly)

Returns the value of attribute version_major.



226
227
228
# File 'lib/amq/protocol/client.rb', line 226

def version_major
  @version_major
end

#version_minorObject (readonly)

Returns the value of attribute version_minor.



226
227
228
# File 'lib/amq/protocol/client.rb', line 226

def version_minor
  @version_minor
end

Class Method Details

.decode(data) ⇒ Object

Returns:



206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
# File 'lib/amq/protocol/client.rb', line 206

def self.decode(data)
  offset = offset = 0 # self-assigning offset to eliminate "assigned but unused variable" warning even if offset is not used in this method
  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)


235
236
237
# File 'lib/amq/protocol/client.rb', line 235

def self.has_content?
  false
end