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.
31 32 33 34 |
# File 'lib/command_kit/arguments/argument_value.rb', line 31 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.
15 16 17 |
# File 'lib/command_kit/arguments/argument_value.rb', line 15 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.
20 21 22 |
# File 'lib/command_kit/arguments/argument_value.rb', line 20 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.
50 51 52 |
# File 'lib/command_kit/arguments/argument_value.rb', line 50 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.
41 42 43 |
# File 'lib/command_kit/arguments/argument_value.rb', line 41 def required? @required end |