Class: CommandKit::Arguments::ArgumentValue Private
- Inherits:
-
Object
- Object
- CommandKit::Arguments::ArgumentValue
- Defined in:
- lib/command_kit/arguments/argument_value.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Represents an individual argument value.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#required ⇒ Boolean
readonly
private
Specifies whether the argument value is required or optional.
-
#usage ⇒ String
readonly
private
The usage string to describe the argument value.
Instance Method Summary collapse
-
#initialize(required: true, usage:) ⇒ ArgumentValue
constructor
private
Initializes the argument value.
-
#optional? ⇒ Boolean
private
Determines whether the argument can be omitted.
-
#required? ⇒ Boolean
private
Determines if the argument is required or not.
Constructor Details
#initialize(required: true, usage:) ⇒ ArgumentValue
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Initializes the argument value.
29 30 31 32 |
# File 'lib/command_kit/arguments/argument_value.rb', line 29 def initialize(required: true, usage: ) @required = required @usage = usage end |
Instance Attribute Details
#required ⇒ Boolean (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Specifies whether the argument value is required or optional.
13 14 15 |
# File 'lib/command_kit/arguments/argument_value.rb', line 13 def required @required end |
#usage ⇒ String (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
The usage string to describe the argument value.
18 19 20 |
# File 'lib/command_kit/arguments/argument_value.rb', line 18 def usage @usage end |
Instance Method Details
#optional? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Determines whether the argument can be omitted.
48 49 50 |
# File 'lib/command_kit/arguments/argument_value.rb', line 48 def optional? !@required end |
#required? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Determines if the argument is required or not.
39 40 41 |
# File 'lib/command_kit/arguments/argument_value.rb', line 39 def required? @required end |