Module: VacmanController::Kernel
- Defined in:
- lib/vacman_controller/kernel.rb
Constant Summary collapse
- Mutex =
Thread::Mutex.new
Class Method Summary collapse
-
.[](name) ⇒ Object
Get a Kernel property, that is a runtime parameter of Vacman Controller, stored in the TKernelParms structure.
-
.[]=(name, val) ⇒ Object
Set a Kernel property.
-
.all ⇒ Object
(also: to_h)
Returns all configured parameters.
-
.inspect ⇒ Object
Shows the kernel version, bitness, type and parameters in your development console.
-
.property_names ⇒ Object
Gets the available kernel property names.
-
.version ⇒ Object
Returns the library version as an hash.
Class Method Details
.[](name) ⇒ Object
Get a Kernel property, that is a runtime parameter of Vacman Controller, stored in the TKernelParms structure.
Parameters:
- name
-
The param name. See
property_namesfor a list of available property names.
46 47 48 |
# File 'lib/vacman_controller/kernel.rb', line 46 def [](name) VacmanController::LowLevel.get_kernel_param(name) end |
.[]=(name, val) ⇒ Object
Set a Kernel property.
Parameters:
- name
-
the param name. See
property_namesfor a list of available property names. The Kernel parameters are all int32 properties. - val
-
the integer value
61 62 63 64 65 |
# File 'lib/vacman_controller/kernel.rb', line 61 def []=(name, val) Mutex.synchronize do VacmanController::LowLevel.set_kernel_param(name, val) end end |
.all ⇒ Object Also known as: to_h
Returns all configured parameters
30 31 32 33 34 |
# File 'lib/vacman_controller/kernel.rb', line 30 def all property_names.inject({}) do |h, name| h.update(name => (self[name] rescue "ERROR: #$!")) end end |
.inspect ⇒ Object
Shows the kernel version, bitness, type and parameters in your development console.
22 23 24 25 |
# File 'lib/vacman_controller/kernel.rb', line 22 def inspect "#<#{self.name} version=#{version['version'].inspect} bitness=#{version['bitness'].inspect} "\ "type=#{version['type'].inspect} parameters=#{all.inspect}>>" end |
.property_names ⇒ Object
Gets the available kernel property names
14 15 16 |
# File 'lib/vacman_controller/kernel.rb', line 14 def property_names @_property_names ||= VacmanController::LowLevel.kernel_property_names.freeze end |
.version ⇒ Object
Returns the library version as an hash
7 8 9 |
# File 'lib/vacman_controller/kernel.rb', line 7 def version @_version = VacmanController::LowLevel.library_version end |