Class: CodewarsApi::Client
- Inherits:
-
Object
- Object
- CodewarsApi::Client
- Defined in:
- lib/codewars_api/client.rb
Instance Attribute Summary collapse
-
#api_key ⇒ Object
readonly
Returns the value of attribute api_key.
Instance Method Summary collapse
- #attempt_solution(options) ⇒ Object
- #deferred_response(options) ⇒ Object
- #finalize_solution(options) ⇒ Object
-
#initialize(options = nil) ⇒ Client
constructor
A new instance of Client.
- #kata_info(id_or_slug) ⇒ Object
- #train_next_kata(options) ⇒ Object
- #train_specific_kata(options) ⇒ Object
- #user(username) ⇒ Object
Constructor Details
#initialize(options = nil) ⇒ Client
5 6 7 |
# File 'lib/codewars_api/client.rb', line 5 def initialize( = nil) @api_key = [:api_key] if end |
Instance Attribute Details
#api_key ⇒ Object (readonly)
Returns the value of attribute api_key.
3 4 5 |
# File 'lib/codewars_api/client.rb', line 3 def api_key @api_key end |
Instance Method Details
#attempt_solution(options) ⇒ Object
27 28 29 30 |
# File 'lib/codewars_api/client.rb', line 27 def attempt_solution() add_api_key() AttemptSolution.new() end |
#deferred_response(options) ⇒ Object
37 38 39 40 |
# File 'lib/codewars_api/client.rb', line 37 def deferred_response() add_api_key() DeferredResponse.new() end |
#finalize_solution(options) ⇒ Object
32 33 34 35 |
# File 'lib/codewars_api/client.rb', line 32 def finalize_solution() add_api_key() FinalizeSolution.new() end |
#kata_info(id_or_slug) ⇒ Object
13 14 15 |
# File 'lib/codewars_api/client.rb', line 13 def kata_info(id_or_slug) KataInfo.new(id_or_slug) end |
#train_next_kata(options) ⇒ Object
17 18 19 20 |
# File 'lib/codewars_api/client.rb', line 17 def train_next_kata() add_api_key() TrainNextKata.new() end |
#train_specific_kata(options) ⇒ Object
22 23 24 25 |
# File 'lib/codewars_api/client.rb', line 22 def train_specific_kata() add_api_key() TrainSpecificKata.new() end |