Class: RabbitMQ::FFI::BasicConsume Private

Inherits:
FFI::Struct
  • Object
show all
Defined in:
lib/rabbitmq/ffi/gen/basic_consume.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.idObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



16
17
18
# File 'lib/rabbitmq/ffi/gen/basic_consume.rb', line 16

def self.id
  :basic_consume
end

Instance Method Details

#apply(ticket: nil, queue: nil, consumer_tag: nil, no_local: nil, no_ack: nil, exclusive: nil, nowait: nil, arguments: nil) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



24
25
26
27
28
29
30
31
32
33
34
# File 'lib/rabbitmq/ffi/gen/basic_consume.rb', line 24

def apply(ticket: nil, queue: nil, consumer_tag: nil, no_local: nil, no_ack: nil, exclusive: nil, nowait: nil, arguments: nil)
  self[:ticket] = Integer(ticket) if ticket
  self[:queue] = Bytes.from_s(queue.to_s) if queue
  self[:consumer_tag] = Bytes.from_s(consumer_tag.to_s) if consumer_tag
  self[:no_local] = no_local unless no_local.nil?
  self[:no_ack] = no_ack unless no_ack.nil?
  self[:exclusive] = exclusive unless exclusive.nil?
  self[:nowait] = nowait unless nowait.nil?
  self[:arguments] = Table.from(arguments) if arguments
  self
end

#free!Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



49
50
51
52
53
# File 'lib/rabbitmq/ffi/gen/basic_consume.rb', line 49

def free!
  self[:queue].free!
  self[:consumer_tag].free!
  self[:arguments].free!
end

#idObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



20
21
22
# File 'lib/rabbitmq/ffi/gen/basic_consume.rb', line 20

def id
  :basic_consume
end

#to_h(free = false) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/rabbitmq/ffi/gen/basic_consume.rb', line 36

def to_h(free=false)
  {
    ticket: self[:ticket],
    queue: self[:queue].to_s(free),
    consumer_tag: self[:consumer_tag].to_s(free),
    no_local: self[:no_local],
    no_ack: self[:no_ack],
    exclusive: self[:exclusive],
    nowait: self[:nowait],
    arguments: self[:arguments].to_h(free)
  }
end