Class: RabbitMQ::FFI::ExchangeDeclare Private

Inherits:
FFI::Struct
  • Object
show all
Defined in:
lib/rabbitmq/ffi/gen/exchange_declare.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.



17
18
19
# File 'lib/rabbitmq/ffi/gen/exchange_declare.rb', line 17

def self.id
  :exchange_declare
end

Instance Method Details

#apply(ticket: nil, exchange: nil, type: nil, passive: nil, durable: nil, auto_delete: nil, internal: 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.



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

def apply(ticket: nil, exchange: nil, type: nil, passive: nil, durable: nil, auto_delete: nil, internal: nil, nowait: nil, arguments: nil)
  self[:ticket] = Integer(ticket) if ticket
  self[:exchange] = Bytes.from_s(exchange.to_s) if exchange
  self[:type] = Bytes.from_s(type.to_s) if type
  self[:passive] = passive unless passive.nil?
  self[:durable] = durable unless durable.nil?
  self[:auto_delete] = auto_delete unless auto_delete.nil?
  self[:internal] = internal unless internal.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.



52
53
54
55
56
# File 'lib/rabbitmq/ffi/gen/exchange_declare.rb', line 52

def free!
  self[:exchange].free!
  self[:type].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.



21
22
23
# File 'lib/rabbitmq/ffi/gen/exchange_declare.rb', line 21

def id
  :exchange_declare
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.



38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/rabbitmq/ffi/gen/exchange_declare.rb', line 38

def to_h(free=false)
  {
    ticket: self[:ticket],
    exchange: self[:exchange].to_s(free),
    type: self[:type].to_s(free),
    passive: self[:passive],
    durable: self[:durable],
    auto_delete: self[:auto_delete],
    internal: self[:internal],
    nowait: self[:nowait],
    arguments: self[:arguments].to_h(free)
  }
end