Class: AMQ::Protocol::Confirm::Select

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(nowait) ⇒ Select

Returns a new instance of Select.



2187
2188
2189
# File 'lib/amq/protocol/client.rb', line 2187

def initialize(nowait)
  @nowait = nowait
end

Instance Attribute Details

#nowaitObject (readonly)

Returns the value of attribute nowait.



2186
2187
2188
# File 'lib/amq/protocol/client.rb', line 2186

def nowait
  @nowait
end

Class Method Details

.decode(data) ⇒ Object

Returns:



2178
2179
2180
2181
2182
2183
2184
# File 'lib/amq/protocol/client.rb', line 2178

def self.decode(data)
  offset = 0
  bit_buffer = data[offset, 1].unpack(PACK_CHAR).first
  offset += 1
  nowait = (bit_buffer & (1 << 0)) != 0
  self.new(nowait)
end

.encode(channel, nowait) ⇒ Object

“nowait = false”

Returns:



2197
2198
2199
2200
2201
2202
2203
2204
# File 'lib/amq/protocol/client.rb', line 2197

def self.encode(channel, nowait)
  buffer = ""
  buffer << @packed_indexes
  bit_buffer = 0
  bit_buffer = bit_buffer | (1 << 0) if nowait
  buffer << [bit_buffer].pack(PACK_CHAR)
  MethodFrame.new(buffer, channel)
end

.has_content?Boolean

Returns:

  • (Boolean)


2191
2192
2193
# File 'lib/amq/protocol/client.rb', line 2191

def self.has_content?
  false
end