Module: BSD::Control
- Defined in:
- lib/bsd/control.rb,
lib/bsd/control/context.rb,
lib/bsd/control/feature.rb,
lib/bsd/control/version.rb
Defined Under Namespace
Constant Summary collapse
- Error =
Class.new(RuntimeError)
- VERSION =
"0.2.1"
Class Method Summary collapse
-
.available_features ⇒ Array<BSD::Control::Feature>
Returns an array of available features.
-
.context ⇒ BSD::Control::Context
Returns an instance of BSD::Control::Context.
-
.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
26 27 28 |
# File 'lib/bsd/control.rb', line 26 def self.available_features context.available_features end |
.context ⇒ BSD::Control::Context
Returns an instance of BSD::Control::Context
12 13 14 |
# File 'lib/bsd/control.rb', line 12 def self.context @context ||= BSD::Control::Context.new end |
.feature(name) ⇒ BSD::Control::Feature
Returns an instance of BSD::Control::Feature
44 45 46 47 |
# File 'lib/bsd/control.rb', line 44 def self.feature(name) feature = available_features.find { _1.name == name.to_s } feature || raise(Error, "'#{name}' wasn't found") end |
.library_version ⇒ String
Returns the version of libhbsdcontrol
19 20 21 |
# File 'lib/bsd/control.rb', line 19 def self.library_version context.library_version end |