Update API docs
This commit is contained in:
parent
513aef03e7
commit
10d3bf6413
2 changed files with 6 additions and 5 deletions
|
@ -11,6 +11,7 @@ module BSD::Control
|
||||||
|
|
||||||
##
|
##
|
||||||
# @return [Array<BSD::Control::Feature>]
|
# @return [Array<BSD::Control::Feature>]
|
||||||
|
# Returns an array of available features.
|
||||||
def self.available_features
|
def self.available_features
|
||||||
Feature.available
|
Feature.available
|
||||||
end
|
end
|
||||||
|
@ -19,7 +20,7 @@ module BSD::Control
|
||||||
# @example
|
# @example
|
||||||
# BSD::Control
|
# BSD::Control
|
||||||
# .feature(:mprotect)
|
# .feature(:mprotect)
|
||||||
# .enable!("/usr/local/bin/firefox")
|
# .enable!("/usr/local/bin/emacs-29.2")
|
||||||
#
|
#
|
||||||
# @param [String] name
|
# @param [String] name
|
||||||
# The name of a feature.
|
# The name of a feature.
|
||||||
|
@ -28,9 +29,9 @@ module BSD::Control
|
||||||
# When a feature is not found.
|
# When a feature is not found.
|
||||||
#
|
#
|
||||||
# @return [BSD::Control::Feature]
|
# @return [BSD::Control::Feature]
|
||||||
# Returns an instance of BSD::Control::Feature.
|
# Returns an instance of {BSD::Control::Feature BSD::Control::Feature}.
|
||||||
def self.feature(name)
|
def self.feature(name)
|
||||||
feature = Feature.available.find { _1.name == name.to_s }
|
feature = available_features.find { _1.name == name.to_s }
|
||||||
feature ? feature : raise(Error, "feature '#{name}' wasn't found")
|
feature ? feature : raise(Error, "feature '#{name}' wasn't found")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@ module BSD::Control
|
||||||
class Feature < Struct.new(:name, :enable, :disable)
|
class Feature < Struct.new(:name, :enable, :disable)
|
||||||
##
|
##
|
||||||
# @return [Array<BSD::Control::Feature>]
|
# @return [Array<BSD::Control::Feature>]
|
||||||
# Returns an array of available features.
|
# Returns an array of available features.
|
||||||
def self.available
|
def self.available
|
||||||
BSD::Control::FFI.available_features
|
BSD::Control::FFI.available_features
|
||||||
end
|
end
|
||||||
|
@ -41,7 +41,7 @@ module BSD::Control
|
||||||
end
|
end
|
||||||
|
|
||||||
##
|
##
|
||||||
# Restore system defaults.
|
# Restore system defaults for a given file.
|
||||||
#
|
#
|
||||||
# @param [String] path
|
# @param [String] path
|
||||||
# The path to a file.
|
# The path to a file.
|
||||||
|
|
Loading…
Reference in a new issue