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



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

def argument_specification
  @argument_specification
end

#extrasObject (readonly)

(Object, Hash) The extras associated with the argument



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

def extras
  @extras
end

#given_hyphensObject (readonly)

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



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

def given_hyphens
  @given_hyphens
end

#given_indexObject (readonly)

(Integer) The command-line index of the argument



84
85
86
# File 'lib/clasp/arguments.rb', line 84

def given_index
  @given_index
end

#given_labelObject (readonly)

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



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

def given_label
  @given_label
end

#given_nameObject (readonly)

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



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

def given_name
  @given_name
end

#nameObject (readonly)

(String) The resolved name of the argument



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

def name
  @name
end

Instance Method Details

#argument_aliasObject

DEPRECATED

Use argument_specification



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

def argument_alias; @argument_specification; end

#hashObject

A hash-code for this instance



130
131
132
133
# File 'lib/clasp/arguments.rb', line 130

def hash

	@arg.hash
end

#to_sObject

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



102
103
104
105
# File 'lib/clasp/arguments.rb', line 102

def to_s

	@name
end