Class: Caty::GlobalOption
- Includes:
- HasDescription
- Defined in:
- lib/caty/global_option.rb
Overview
Represents a single global option.
A GlobalOption object is created for every option specified via Caty::global_options(). The sum of all global options parsed is accessible via the Caty#global_options() method.
Instance Attribute Summary
Attributes included from HasDescription
Attributes inherited from Option
Instance Method Summary collapse
-
#to_help ⇒ Object
Returns a string representation to be used by the help system.
- #to_s(ljust = 0) ⇒ Object
Methods included from HasDescription
Methods inherited from Option
Constructor Details
This class inherits a constructor from Caty::Option
Instance Method Details
#to_help ⇒ Object
Returns a string representation to be used by the help system.
21 22 23 |
# File 'lib/caty/global_option.rb', line 21 def to_help [ self.to_s, self.short_description, self.description ] end |
#to_s(ljust = 0) ⇒ Object
25 26 27 28 29 30 31 |
# File 'lib/caty/global_option.rb', line 25 def to_s( ljust = 0 ) returning('') do |str| str << "#{self.prefix}#{@name}=#{ @default.nil? ? '' : @default.inspect }".ljust(ljust) end end |