Class: RabbitMQ::FFI::AccessRequest Private

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



14
15
16
# File 'lib/rabbitmq/ffi/gen/access_request.rb', line 14

def self.id
  :access_request
end

Instance Method Details

#apply(realm: nil, exclusive: nil, passive: nil, active: nil, write: nil, read: 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.



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

def apply(realm: nil, exclusive: nil, passive: nil, active: nil, write: nil, read: nil)
  self[:realm] = Bytes.from_s(realm.to_s) if realm
  self[:exclusive] = exclusive unless exclusive.nil?
  self[:passive] = passive unless passive.nil?
  self[:active] = active unless active.nil?
  self[:write] = write unless write.nil?
  self[:read] = read unless read.nil?
  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.



43
44
45
# File 'lib/rabbitmq/ffi/gen/access_request.rb', line 43

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



18
19
20
# File 'lib/rabbitmq/ffi/gen/access_request.rb', line 18

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



32
33
34
35
36
37
38
39
40
41
# File 'lib/rabbitmq/ffi/gen/access_request.rb', line 32

def to_h(free=false)
  {
    realm: self[:realm].to_s(free),
    exclusive: self[:exclusive],
    passive: self[:passive],
    active: self[:active],
    write: self[:write],
    read: self[:read]
  }
end