Class: L43::Time::TimeCalc::Cli
- Inherits:
-
Object
- Object
- L43::Time::TimeCalc::Cli
- Includes:
- Color::Output, FormatTime, Calculate
- Defined in:
- lib/l43/time/time_calc/cli.rb,
lib/l43/time/time_calc/cli/help.rb,
lib/l43/time/time_calc/cli/arguments.rb
Defined Under Namespace
Constant Summary
Constants included from FormatTime
Instance Attribute Summary collapse
-
#arg_parser ⇒ Object
readonly
Returns the value of attribute arg_parser.
-
#args ⇒ Object
readonly
Returns the value of attribute args.
-
#format ⇒ Object
readonly
Returns the value of attribute format.
-
#kwds ⇒ Object
readonly
Returns the value of attribute kwds.
Instance Method Summary collapse
Methods included from FormatTime
Methods included from L43::Time::Tools::MapOk
Instance Attribute Details
#arg_parser ⇒ Object (readonly)
Returns the value of attribute arg_parser.
21 22 23 |
# File 'lib/l43/time/time_calc/cli.rb', line 21 def arg_parser @arg_parser end |
#args ⇒ Object (readonly)
Returns the value of attribute args.
21 22 23 |
# File 'lib/l43/time/time_calc/cli.rb', line 21 def args @args end |
#format ⇒ Object (readonly)
Returns the value of attribute format.
21 22 23 |
# File 'lib/l43/time/time_calc/cli.rb', line 21 def format @format end |
#kwds ⇒ Object (readonly)
Returns the value of attribute kwds.
21 22 23 |
# File 'lib/l43/time/time_calc/cli.rb', line 21 def kwds @kwds end |
Instance Method Details
#run(argv) ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/l43/time/time_calc/cli.rb', line 25 def run(argv) result = arg_parser.parse(argv) case result in true, args, [], kwds @args = args @kwds = kwds _run in false, _, errors, _ errors.each do |error| putcol(error, to: $stderr) end end end |