Module: CommandKit::XDG::ClassMethods

Defined in:
lib/command_kit/xdg.rb

Overview

Class-level methods.

Instance Method Summary collapse

Instance Method Details

#xdg_namespace(new_namespace = nil) ⇒ String

Gets or sets the XDG sub-directory name used by the command.

Parameters:

  • new_namespace (#to_s, nil) (defaults to: nil)

    If a new_namespace argument is given, it will set the class'es #xdg_namespace string.

Returns:



71
72
73
74
75
76
77
78
79
80
81
# File 'lib/command_kit/xdg.rb', line 71

def xdg_namespace(new_namespace=nil)
  if new_namespace
    @xdg_namespace = new_namespace.to_s
  else
    @xdg_namespace || if superclass.kind_of?(ClassMethods)
                        superclass.xdg_namespace
                      else
                        command_name
                      end
  end
end