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.2"
Class Method Summary collapse
-
.context ⇒ BSD::Control::Context
Returns an instance of BSD::Control::Context.
-
.library_version ⇒ String
Returns the version of libhbsdcontrol.
-
.available_features ⇒ Array<BSD::Control::Feature>
Returns an array of available features.
-
.feature(name) ⇒ BSD::Control::Feature
Returns an instance of BSD::Control::Feature.
Class Method Details
.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 |
.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 |
.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 |
.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 |