Class: CZTop::Config::Traversing::ChildrenAccessor
- Inherits:
-
FamilyAccessor
- Object
- FamilyAccessor
- CZTop::Config::Traversing::ChildrenAccessor
- Defined in:
- lib/cztop/config/traversing.rb
Overview
Accesses the direct children of a given CZTop::Config item.
Instance Method Summary collapse
- #first ⇒ Object
-
#new(name = nil, value = nil) {|config| ... } ⇒ Config
Adds a new Config item and yields it, so it can be configured in a block.
Methods inherited from FamilyAccessor
Constructor Details
This class inherits a constructor from CZTop::Config::Traversing::FamilyAccessor
Instance Method Details
#first ⇒ Object
135 136 137 138 139 140 |
# 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| ... } ⇒ Config
Adds a new Config item and yields it, so it can be configured in a block.
149 150 151 152 153 |
# 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 |