Class: Cmdline::Option
- Inherits:
-
Struct
- Object
- Struct
- Cmdline::Option
- Defined in:
- lib/cmdline.rb,
lib/cmdline.rb
Instance Attribute Summary collapse
-
#default ⇒ Object
Returns the value of attribute default.
-
#description ⇒ Object
Returns the value of attribute description.
-
#long_name ⇒ Object
Returns the value of attribute long_name.
-
#set ⇒ Object
Returns the value of attribute set.
-
#short_name ⇒ Object
Returns the value of attribute short_name.
-
#value ⇒ Object
Returns the value of attribute value.
-
#value_string ⇒ Object
Returns the value of attribute value_string.
Instance Method Summary collapse
-
#initialize ⇒ Option
constructor
A new instance of Option.
- #sort_key ⇒ Object
Constructor Details
#initialize ⇒ Option
Returns a new instance of Option.
28 29 30 31 32 33 34 35 36 37 |
# File 'lib/cmdline.rb', line 28 def initialize(*) super self.short_name ||= "" self.long_name ||= "" self.value_string ||= "" self.description ||= "" self.default ||= "" self.set ||= false self.value ||= "" end |
Instance Attribute Details
#default ⇒ Object
Returns the value of attribute default
16 17 18 |
# File 'lib/cmdline.rb', line 16 def default @default end |
#description ⇒ Object
Returns the value of attribute description
16 17 18 |
# File 'lib/cmdline.rb', line 16 def description @description end |
#long_name ⇒ Object
Returns the value of attribute long_name
16 17 18 |
# File 'lib/cmdline.rb', line 16 def long_name @long_name end |
#set ⇒ Object
Returns the value of attribute set
16 17 18 |
# File 'lib/cmdline.rb', line 16 def set @set end |
#short_name ⇒ Object
Returns the value of attribute short_name
16 17 18 |
# File 'lib/cmdline.rb', line 16 def short_name @short_name end |
#value ⇒ Object
Returns the value of attribute value
16 17 18 |
# File 'lib/cmdline.rb', line 16 def value @value end |
#value_string ⇒ Object
Returns the value of attribute value_string
16 17 18 |
# File 'lib/cmdline.rb', line 16 def value_string @value_string end |
Instance Method Details
#sort_key ⇒ Object
39 40 41 42 43 |
# File 'lib/cmdline.rb', line 39 def sort_key return short_name unless short_name.empty? return long_name unless long_name.empty? "" end |