Class: GLI::CommandLineToken
- Inherits:
-
Object
- Object
- GLI::CommandLineToken
- Defined in:
- lib/gli/command_line_token.rb
Overview
Logical element of a command line, mostly so that subclasses can have similar initialization and interface
Instance Attribute Summary collapse
-
#aliases ⇒ Object
readonly
Returns the value of attribute aliases.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#long_description ⇒ Object
readonly
Returns the value of attribute long_description.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #<=>(other) ⇒ Object
-
#initialize(names, description, long_description = nil) ⇒ CommandLineToken
constructor
A new instance of CommandLineToken.
- #usage ⇒ Object
Constructor Details
#initialize(names, description, long_description = nil) ⇒ CommandLineToken
Returns a new instance of CommandLineToken.
10 11 12 13 14 |
# File 'lib/gli/command_line_token.rb', line 10 def initialize(names,description,long_description=nil) @description = description @long_description = long_description @name,@aliases,@names = parse_names(names) end |
Instance Attribute Details
#aliases ⇒ Object (readonly)
Returns the value of attribute aliases.
6 7 8 |
# File 'lib/gli/command_line_token.rb', line 6 def aliases @aliases end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
7 8 9 |
# File 'lib/gli/command_line_token.rb', line 7 def description @description end |
#long_description ⇒ Object (readonly)
Returns the value of attribute long_description.
8 9 10 |
# File 'lib/gli/command_line_token.rb', line 8 def long_description @long_description end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/gli/command_line_token.rb', line 5 def name @name end |
Instance Method Details
#<=>(other) ⇒ Object
20 21 22 |
# File 'lib/gli/command_line_token.rb', line 20 def <=>(other) self.name.to_s <=> other.name.to_s end |
#usage ⇒ Object
16 17 18 |
# File 'lib/gli/command_line_token.rb', line 16 def usage all_forms end |