Class: RabbitMQ::FFI::ChannelClose Private

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



12
13
14
# File 'lib/rabbitmq/ffi/gen/channel_close.rb', line 12

def self.id
  :channel_close
end

Instance Method Details

#apply(reply_code: nil, reply_text: nil, method: 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.



20
21
22
23
24
25
26
27
28
29
# File 'lib/rabbitmq/ffi/gen/channel_close.rb', line 20

def apply(reply_code: nil, reply_text: nil, method: nil)
  if method
    method_id = FFI::MethodNumber[method.to_sym]
    self[:class_id] = method_id >> 16
    self[:method_id] = method_id & 0xFFFF
  end
  self[:reply_code] = Integer(reply_code) if reply_code
  self[:reply_text] = Bytes.from_s(reply_text.to_s) if reply_text
  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.



39
40
41
# File 'lib/rabbitmq/ffi/gen/channel_close.rb', line 39

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



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

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



31
32
33
34
35
36
37
# File 'lib/rabbitmq/ffi/gen/channel_close.rb', line 31

def to_h(free=false)
  {
    reply_code: self[:reply_code],
    reply_text: self[:reply_text].to_s(free),
    method: FFI::MethodNumber[self[:method_id] + (self[:class_id] << 16)]
  }
end