Class: Jakdlugo::CLI
- Inherits:
-
Object
- Object
- Jakdlugo::CLI
- Defined in:
- lib/jakdlugo.rb
Instance Method Summary collapse
-
#initialize ⇒ CLI
constructor
A new instance of CLI.
- #run(args) ⇒ Object
Constructor Details
#initialize ⇒ CLI
Returns a new instance of CLI.
10 11 12 |
# File 'lib/jakdlugo.rb', line 10 def initialize @app = CourseData.new end |
Instance Method Details
#run(args) ⇒ Object
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/jakdlugo.rb', line 14 def run(args) subcommand, first_arg, second_arg = args.map(&:downcase) case subcommand when "-c", "--course" then @app.course_summary(first_arg) when "-t", "--track" then @app.track_summary(first_arg) when "-p", "--progress" then @app.progress_summary(first_arg, second_arg) else end end |