Class: Debtective::Command
- Inherits:
-
Object
- Object
- Debtective::Command
- Defined in:
- lib/debtective/command.rb
Overview
Handle commands from CLI
Instance Method Summary collapse
-
#call ⇒ Object
Forward to the proper command.
-
#initialize(args) ⇒ Command
constructor
A new instance of Command.
Constructor Details
#initialize(args) ⇒ Command
Returns a new instance of Command.
10 11 12 |
# File 'lib/debtective/command.rb', line 10 def initialize(args) @args = args end |
Instance Method Details
#call ⇒ Object
Forward to the proper command
15 16 17 18 19 20 21 22 23 24 |
# File 'lib/debtective/command.rb', line 15 def call case @args.first&.delete("--") when "comments" Debtective::Comments::Command.new(@args, quiet: quiet?).call when "gems" puts "Upcoming feature!" else puts "Please pass one of this options: [--comments, --gems]" end end |