Class: CTioga2::Commands::CommandArgument
- Inherits:
-
Object
- Object
- CTioga2::Commands::CommandArgument
- Defined in:
- lib/ctioga2/commands/arguments.rb
Overview
An argument to a Command
Instance Attribute Summary collapse
-
#description ⇒ Object
A small description of the argument.
-
#name ⇒ Object
The name of the argument.
-
#type ⇒ Object
The type of the argument, a CTioga2::MetaBuilder::Type object.
Instance Method Summary collapse
-
#displayed_name ⇒ Object
Returns a name suitable for display in a documentation, such as the command-line help.
-
#initialize(type, name = nil, desc = nil) ⇒ CommandArgument
constructor
type is a named CommandType.
Constructor Details
#initialize(type, name = nil, desc = nil) ⇒ CommandArgument
type is a named CommandType
37 38 39 40 41 |
# File 'lib/ctioga2/commands/arguments.rb', line 37 def initialize(type, name = nil, desc = nil) @type = CommandType.get_type(type) @name = name @description = desc end |
Instance Attribute Details
#description ⇒ Object
A small description of the argument
34 35 36 |
# File 'lib/ctioga2/commands/arguments.rb', line 34 def description @description end |
#name ⇒ Object
The name of the argument. Uniquely for display in the help documentation.
31 32 33 |
# File 'lib/ctioga2/commands/arguments.rb', line 31 def name @name end |
#type ⇒ Object
The type of the argument, a CTioga2::MetaBuilder::Type object.
27 28 29 |
# File 'lib/ctioga2/commands/arguments.rb', line 27 def type @type end |
Instance Method Details
#displayed_name ⇒ Object
Returns a name suitable for display in a documentation, such as the command-line help.
45 46 47 48 49 50 51 |
# File 'lib/ctioga2/commands/arguments.rb', line 45 def displayed_name if @name return @name else return @type.name end end |