Class: Codewars::TrainNext
- Inherits:
-
Thor
- Object
- Thor
- Codewars::TrainNext
- Defined in:
- lib/codewars/train_next.rb
Instance Method Summary collapse
-
#initialize ⇒ TrainNext
constructor
A new instance of TrainNext.
Constructor Details
#initialize ⇒ TrainNext
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/codewars/train_next.rb', line 3 def initialize = [] api_key = Configuration.option('api_key') .push 'You should set an api-key to use this command' unless api_key language = Configuration.option('language') .push 'You should set an default language to use this command' unless language fail Thor::Error, .join("\n") unless .empty? client = CodewarsApi::Client.new(api_key: api_key) kata = client.train_next_kata( language: language.split(',').first, peek: 'true', strategy: 'default' ) handle_next_kata(kata) end |