Update API docs

This commit is contained in:
0x1eef 2024-03-08 02:21:24 -03:00
parent 10d3bf6413
commit fdd89003eb

View file

@ -55,21 +55,35 @@ module BSD::Control
FFI.sysdef!(self, path) FFI.sysdef!(self, path)
end end
# @endgroup
## ##
# @group Queries
##
# @param [String] path
# The path to a file.
#
# @return [Boolean] # @return [Boolean]
# Returns true when a feature is enabled. # Returns true when a feature is enabled for a given file.
def enabled?(path) def enabled?(path)
status(path) == :enabled status(path) == :enabled
end end
## ##
# @param [String] path
# The path to a file.
#
# @return [Boolean] # @return [Boolean]
# Returns true when a feature is disabled. # Returns true when a feature is disabled for a given file.
def disabled?(path) def disabled?(path)
status(path) == :disabled status(path) == :disabled
end end
## ##
# @param [String] path
# The path to a file.
#
# @return [Boolean] # @return [Boolean]
# Returns true when a feature is configured to use the system default. # Returns true when a feature is configured to use the system default.
def sysdef?(path) def sysdef?(path)
@ -77,6 +91,9 @@ module BSD::Control
end end
## ##
# @param [String] path
# The path to a file.
#
# @return [Boolean] # @return [Boolean]
# Returns true when a feature is in conflict # Returns true when a feature is in conflict
# (i.e: the feature is both enabled and disabled at the same time). # (i.e: the feature is both enabled and disabled at the same time).
@ -87,8 +104,12 @@ module BSD::Control
## ##
# @param [String] path # @param [String] path
# The path to a file. # The path to a file.
#
# @raise [SystemCallError]
# Might raise a number of Errno exceptions.
#
# @return [Symbol] # @return [Symbol]
# Returns the feature status of a file. # Returns the status of a feature for a given file.
# Status can be one of: `:conflict`, `:sysdef`, `:enabled`, `:disabled`. # Status can be one of: `:conflict`, `:sysdef`, `:enabled`, `:disabled`.
def status(path) def status(path)
FFI.status(self, path) FFI.status(self, path)