class Cmdlib::Option
Class for create option object.
Attributes
brief[RW]
Contain text with describe option (String).
longname[RW]
Contain text with option long name (String).
param[RW]
Contain parameter tag, the option can be have a parameter.
shortname[RW]
Contain text with option short name (String).
value[RW]
Contain option value.
Public Class Methods
new( sname, lname, brief = '', param = false )
click to toggle source
Set option shortname (sname) and longname (lname).
# File lib/cmdlib/option.rb, line 21 def initialize ( sname, lname, brief = '', param = false ) raise TypeError, 'Incorrectly types for option constructor.' unless sname.instance_of? String and lname.instance_of? String and brief.instance_of? String and sname.length == 1 and lname.length > 1 @shortname = sname @longname = lname @brief = brief @value = nil @param = param end