Class: Termory::OptparsrTermory
- Inherits:
-
Object
- Object
- Termory::OptparsrTermory
- Defined in:
- lib/termory/optpare.rb
Defined Under Namespace
Classes: ScriptOptions
Constant Summary collapse
- Version =
'1.0.0'
- CODES =
%w[iso-2022-jp shift_jis euc-jp utf8 binary]
- CODE_ALIASES =
{ "jis" => "iso-2022-jp", "sjis" => "shift_jis" }
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#parser ⇒ Object
readonly
Returns the value of attribute parser.
Instance Method Summary collapse
-
#parse(args) ⇒ Object
Return a structure describing the options.
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
81 82 83 |
# File 'lib/termory/optpare.rb', line 81 def @options end |
#parser ⇒ Object (readonly)
Returns the value of attribute parser.
81 82 83 |
# File 'lib/termory/optpare.rb', line 81 def parser @parser end |
Instance Method Details
#parse(args) ⇒ Object
Return a structure describing the options.
69 70 71 72 73 74 75 76 77 78 79 |
# File 'lib/termory/optpare.rb', line 69 def parse(args) # The options specified on the command line will be collected in # *options*. @options = ScriptOptions.new @args = OptionParser.new do |parser| @options.(parser) parser.parse!(args) end @options end |