- Parent Namespace
- Cuprum::Cli::Metadata
- Defined In
- lib/cuprum/cli/metadata.rb
Table Of Contents
Overview
Class methods to extend when including Metadata.
Back To Top
Instance Methods
#abstract => Object
Marks the command as abstract.
#abstract? => true, false
Returns
- (true, false) — true if the command is abstract and should not be
instantiated directly or assigned metadata; otherwise false.
#description => String
#description(value) => String
Overloads
#description => String
Returns
- (String) — the description for the command.
#description(value) => String
Sets the description for the command.
Parameters
- value (String) — the description to set.
Returns
- (String) — the set description.
#description? => true, false
Returns
- (true, false) — true if the command defines a description;
otherwise false.
#full_description => String
#full_description(value) => String
Overloads
#full_description => String
Returns
- (String) — the full description for the command.
#full_description(value) => String
Sets the full description for the command.
Parameters
- value (String) — the full description to set.
Returns
- (String) — the set full description.
#full_description? => true, false
Returns
- (true, false) — true if the command defines a full description;
otherwise false.
#full_name => String
#full_name(value) => String
Overloads
#full_name => String
Returns the name of the command, used when calling from a CLI.
Unless another value is set, defaults to the class name of the command
with the following format:
- Removes the “Commands” namespace and any prior namespace, if any.
- Removes a “Command” suffix, if any.
- Converts each remaining segment to snake_case and joins with “:”.
Returns
- (String) — the scoped name for the command.
#full_name(value) => String
Sets the full name for the command.
The full name must be in snake_case format joined by “:”.
Parameters
- value (String) — the full name to set.
Returns
- (String) — the set full name.
#namespace => String, nil
The namespace for the command.
A command’s namespace is defined as the part of the full name prior to
the last segment.
- For a command with full name “custom”, the namespace will be nil.
- For a command with full name “category:sub_category:do_something”, the
namespace will be “category:sub_category”.
Returns
- (String, nil) — the namespace for the command, or nil if the
command's full name is unscoped.
See Also
#namespace? => true, false
Returns
- (true, false) — true if the command defines a namespace; otherwise
false.
#short_name => String
The short name for the command.
A command’s short_name is the last segment of the full name.
- For a command with full name “custom”, the short_name will be
“custom”.
- For a command with full name “category:sub_category:do_something”, the
short_name will be “do_something”.
Returns
- (String) — the short name for the command.
Back To Top
Back to
Documentation |
Reference
|
Cuprum
|
Cuprum::Cli
|
Cuprum::Cli::Metadata