Class: CLASP::Arguments::FlagArgument

Inherits:
Object
  • Object
show all
Defined in:
lib/clasp/arguments.rb

Overview

Class that represents a parsed flag

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#argument_specificationObject (readonly)

(CLASP::FlagSpecification) The specification matching the argument, or nil



90
91
92
# File 'lib/clasp/arguments.rb', line 90

def argument_specification
  @argument_specification
end

#extrasObject (readonly)

(Object, Hash) The extras associated with the argument



98
99
100
# File 'lib/clasp/arguments.rb', line 98

def extras
  @extras
end

#given_hyphensObject (readonly)

(Integer) The number of hyphens of the argument as it appeared in the command-line



92
93
94
# File 'lib/clasp/arguments.rb', line 92

def given_hyphens
  @given_hyphens
end

#given_indexObject (readonly)

(Integer) The command-line index of the argument



86
87
88
# File 'lib/clasp/arguments.rb', line 86

def given_index
  @given_index
end

#given_labelObject (readonly)

(String) The label of the argument as it appeared in the command-line



94
95
96
# File 'lib/clasp/arguments.rb', line 94

def given_label
  @given_label
end

#given_nameObject (readonly)

(String) The given name of the argument as it appeared in the command-line



88
89
90
# File 'lib/clasp/arguments.rb', line 88

def given_name
  @given_name
end

#nameObject (readonly)

(String) The resolved name of the argument



96
97
98
# File 'lib/clasp/arguments.rb', line 96

def name
  @name
end

Instance Method Details

#argument_aliasObject

DEPRECATED

Use argument_specification



101
# File 'lib/clasp/arguments.rb', line 101

def argument_alias; @argument_specification; end

#hashObject

A hash-code for this instance



132
133
134
135
# File 'lib/clasp/arguments.rb', line 132

def hash

    @arg.hash
end

#to_sObject

(String) The string form of the flag, which is the same as name



104
105
106
107
# File 'lib/clasp/arguments.rb', line 104

def to_s

    @name
end