class CZTop::Config::Traversing::ChildrenAccessor

Accesses the direct children of a given {Config} item.

Public Instance Methods

first() click to toggle source
# File lib/cztop/config/traversing.rb, line 135
def first
  ptr = @config.ffi_delegate.child
  return nil if ptr.null?

  CZTop::Config.from_ffi_delegate(ptr)
end
new(name = nil, value = nil) { |config| ... } click to toggle source

Adds a new Config item and yields it, so it can be configured in a block. @param name [String] name for new config item @param value [String] value for new config item @yieldparam config [Config] the new config item, if block was given @return [Config] the new config item

# File lib/cztop/config/traversing.rb, line 149
def new(name = nil, value = nil)
  config = CZTop::Config.new(name, value, parent: @config)
  yield config if block_given?
  config
end