lib/command_kit/xdg.rb in command_kit-0.1.0.rc1 vs lib/command_kit/xdg.rb in command_kit-0.1.0
- old
+ new
@@ -22,10 +22,13 @@
#
module XDG
include CommandName
include Env::Home
+ #
+ # @api private
+ #
module ModuleMethods
#
# Extends {ClassMethods} or {ModuleMethods}, depending on whether {XDG} is
# being included into a class or a module..
#
@@ -59,10 +62,12 @@
# @return [String]
# The class'es or superclass'es {#xdg_namespace}. Defaults to
# {CommandName::ClassMethods#command_name} if no {#xdg_namespace} has
# been defined.
#
+ # @api public
+ #
def xdg_namespace(new_namespace=nil)
if new_namespace
@xdg_namespace = new_namespace.to_s
else
@xdg_namespace || if superclass.kind_of?(ClassMethods)
@@ -75,20 +80,26 @@
end
# The `~/.config/<xdg_namespace>` directory.
#
# @return [String]
+ #
+ # @api public
attr_reader :config_dir
# The `~/.local/share/<xdg_namespace>` directory.
#
# @return [String]
+ #
+ # @api public
attr_reader :local_share_dir
# The `~/.cache/<xdg_namespace>` directory.
#
# @return [String]
+ #
+ # @api public
attr_reader :cache_dir
#
# Initializes {#config_dir}, {#local_share_dir}, and {#cache_dir}.
#
@@ -135,9 +146,11 @@
@cache_dir = File.join(xdg_cache_home,xdg_namespace)
end
#
# @see ClassMethods#xdg_namespace
+ #
+ # @api semipublic
#
def xdg_namespace
self.class.xdg_namespace
end
end