Module: BSD::Control
- Defined in:
- lib/bsd/control.rb,
lib/bsd/control/feature.rb,
lib/bsd/control/version.rb
Defined Under Namespace
Constant Summary collapse
- Error =
Class.new(RuntimeError)
- VERSION =
"0.1.0"
Class Method Summary collapse
-
.available_features ⇒ Array<BSD::Control::Feature>
Returns an array of available features.
-
.feature(name) ⇒ BSD::Control::Feature
Returns an instance of BSD::Control::Feature.
-
.library_version ⇒ String
Returns the version of libhbsdcontrol.
Class Method Details
.available_features ⇒ Array<BSD::Control::Feature>
Returns an array of available features.
15 16 17 |
# File 'lib/bsd/control.rb', line 15 def self.available_features Feature.available end |
.feature(name) ⇒ BSD::Control::Feature
Returns an instance of BSD::Control::Feature.
33 34 35 36 |
# File 'lib/bsd/control.rb', line 33 def self.feature(name) feature = available_features.find { _1.name == name.to_s } feature ? feature : raise(Error, "feature '#{name}' wasn't found") end |
.library_version ⇒ String
Returns the version of libhbsdcontrol.
8 9 10 |
# File 'lib/bsd/control.rb', line 8 def self.library_version FFI.library_version end |