class CodewarsApi::Client
Attributes
api_key[R]
Public Class Methods
new(options = nil)
click to toggle source
# File lib/codewars_api/client.rb, line 5 def initialize(options = nil) @api_key = options[:api_key] if options end
Public Instance Methods
attempt_solution(options)
click to toggle source
# File lib/codewars_api/client.rb, line 27 def attempt_solution(options) add_api_key(options) AttemptSolution.new(options) end
deferred_response(options)
click to toggle source
# File lib/codewars_api/client.rb, line 37 def deferred_response(options) add_api_key(options) DeferredResponse.new(options) end
finalize_solution(options)
click to toggle source
# File lib/codewars_api/client.rb, line 32 def finalize_solution(options) add_api_key(options) FinalizeSolution.new(options) end
kata_info(id_or_slug)
click to toggle source
# File lib/codewars_api/client.rb, line 13 def kata_info(id_or_slug) KataInfo.new(id_or_slug) end
train_next_kata(options)
click to toggle source
# File lib/codewars_api/client.rb, line 17 def train_next_kata(options) add_api_key(options) TrainNextKata.new(options) end
train_specific_kata(options)
click to toggle source
# File lib/codewars_api/client.rb, line 22 def train_specific_kata(options) add_api_key(options) TrainSpecificKata.new(options) end
user(username)
click to toggle source
# File lib/codewars_api/client.rb, line 9 def user(username) User.new(username) end
Private Instance Methods
add_api_key(options)
click to toggle source
# File lib/codewars_api/client.rb, line 44 def add_api_key(options) options[:api_key] = @api_key end