class CommandKit::Arguments::ArgumentValue

Represents an individual argument value.

@api private

Attributes

required[R]

Specifies whether the argument value is required or optional.

@return [Boolean]

usage[R]

The usage string to describe the argument value.

@return [String]

Public Class Methods

new(required: true, usage: ) click to toggle source

Initializes the argument value.

@param [Boolean] required

Specifies whether the argument value is required or optional.

@param [String] usage

The usage string to represent the argument value.
# File lib/command_kit/arguments/argument_value.rb, line 29
def initialize(required: true, usage: )
  @required = required
  @usage    = usage
end

Public Instance Methods

optional?() click to toggle source

Determines whether the argument can be omitted.

@return [Boolean]

# File lib/command_kit/arguments/argument_value.rb, line 48
def optional?
  !@required
end
required?() click to toggle source

Determines if the argument is required or not.

@return [Boolean]

# File lib/command_kit/arguments/argument_value.rb, line 39
def required?
  @required
end