Class: Leetcoder::Cli
- Inherits:
-
Object
- Object
- Leetcoder::Cli
- Includes:
- Helpers::ErrorHandler
- Defined in:
- lib/leetcoder/leetcoder/cli.rb
Instance Attribute Summary collapse
-
#args ⇒ Object
readonly
Returns the value of attribute args.
-
#commands ⇒ Object
readonly
Returns the value of attribute commands.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(args) ⇒ Cli
constructor
A new instance of Cli.
- #start ⇒ Object
Methods included from Helpers::ErrorHandler
Constructor Details
#initialize(args) ⇒ Cli
Returns a new instance of Cli.
10 11 12 13 |
# File 'lib/leetcoder/leetcoder/cli.rb', line 10 def initialize(args) @args = args @commands = Commands.new end |
Instance Attribute Details
#args ⇒ Object (readonly)
Returns the value of attribute args.
8 9 10 |
# File 'lib/leetcoder/leetcoder/cli.rb', line 8 def args @args end |
#commands ⇒ Object (readonly)
Returns the value of attribute commands.
8 9 10 |
# File 'lib/leetcoder/leetcoder/cli.rb', line 8 def commands @commands end |
Class Method Details
.start(args = ARGV.dup) ⇒ Object
15 16 17 |
# File 'lib/leetcoder/leetcoder/cli.rb', line 15 def self.start(args = ARGV.dup) new(args).start end |
Instance Method Details
#start ⇒ Object
19 20 21 22 23 |
# File 'lib/leetcoder/leetcoder/cli.rb', line 19 def start error_handler do option_parser end end |