Update API docs

This commit is contained in:
0x1eef 2024-03-08 02:17:15 -03:00
parent 513aef03e7
commit 10d3bf6413
2 changed files with 6 additions and 5 deletions

View file

@ -11,6 +11,7 @@ module BSD::Control
##
# @return [Array<BSD::Control::Feature>]
# Returns an array of available features.
def self.available_features
Feature.available
end
@ -19,7 +20,7 @@ module BSD::Control
# @example
# BSD::Control
# .feature(:mprotect)
# .enable!("/usr/local/bin/firefox")
# .enable!("/usr/local/bin/emacs-29.2")
#
# @param [String] name
# The name of a feature.
@ -28,9 +29,9 @@ module BSD::Control
# When a feature is not found.
#
# @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)
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")
end

View file

@ -2,7 +2,7 @@ module BSD::Control
class Feature < Struct.new(:name, :enable, :disable)
##
# @return [Array<BSD::Control::Feature>]
# Returns an array of available features.
# Returns an array of available features.
def self.available
BSD::Control::FFI.available_features
end
@ -41,7 +41,7 @@ module BSD::Control
end
##
# Restore system defaults.
# Restore system defaults for a given file.
#
# @param [String] path
# The path to a file.