Class: Rdkafka::Admin::ConfigBindingResult

Inherits:
Object
  • Object
show all
Defined in:
lib/rdkafka/admin/config_binding_result.rb

Overview

A single config binding result that represents its values extracted from C

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config_ptr) ⇒ ConfigBindingResult

Returns a new instance of ConfigBindingResult.

Parameters:

  • config_ptr (FFI::Pointer)

    config pointer



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/rdkafka/admin/config_binding_result.rb', line 10

def initialize(config_ptr)
  @name = Bindings.rd_kafka_ConfigEntry_name(config_ptr)
  @value = Bindings.rd_kafka_ConfigEntry_value(config_ptr)
  @read_only = Bindings.rd_kafka_ConfigEntry_is_read_only(config_ptr)
  @default = Bindings.rd_kafka_ConfigEntry_is_default(config_ptr)
  @sensitive = Bindings.rd_kafka_ConfigEntry_is_sensitive(config_ptr)
  @synonym = Bindings.rd_kafka_ConfigEntry_is_synonym(config_ptr)
  @synonyms = []

  # The code below builds up the config synonyms using same config binding
  pointer_to_size_t = FFI::MemoryPointer.new(:int32)
  synonym_ptr = Bindings.rd_kafka_ConfigEntry_synonyms(config_ptr, pointer_to_size_t)
  synonyms_ptr = synonym_ptr.read_array_of_pointer(pointer_to_size_t.read_int)

  (1..pointer_to_size_t.read_int).map do |ar|
    self.class.new synonyms_ptr[ar - 1]
  end
end

Instance Attribute Details

#defaultObject (readonly)

Returns the value of attribute default.



7
8
9
# File 'lib/rdkafka/admin/config_binding_result.rb', line 7

def default
  @default
end

#nameObject (readonly)

Returns the value of attribute name.



7
8
9
# File 'lib/rdkafka/admin/config_binding_result.rb', line 7

def name
  @name
end

#read_onlyObject (readonly)

Returns the value of attribute read_only.



7
8
9
# File 'lib/rdkafka/admin/config_binding_result.rb', line 7

def read_only
  @read_only
end

#sensitiveObject (readonly)

Returns the value of attribute sensitive.



7
8
9
# File 'lib/rdkafka/admin/config_binding_result.rb', line 7

def sensitive
  @sensitive
end

#synonymObject (readonly)

Returns the value of attribute synonym.



7
8
9
# File 'lib/rdkafka/admin/config_binding_result.rb', line 7

def synonym
  @synonym
end

#synonymsObject (readonly)

Returns the value of attribute synonyms.



7
8
9
# File 'lib/rdkafka/admin/config_binding_result.rb', line 7

def synonyms
  @synonyms
end

#valueObject (readonly)

Returns the value of attribute value.



7
8
9
# File 'lib/rdkafka/admin/config_binding_result.rb', line 7

def value
  @value
end