Class: CodewarsApi::DeferredResponse
- Inherits:
-
Object
- Object
- CodewarsApi::DeferredResponse
- Includes:
- Common
- Defined in:
- lib/codewars_api/deferred_response.rb
Instance Method Summary collapse
- #dmid ⇒ Object
- #errors ⇒ Object
- #failed ⇒ Object
-
#initialize(options) ⇒ DeferredResponse
constructor
A new instance of DeferredResponse.
- #output ⇒ Object
- #passed ⇒ Object
- #server_error ⇒ Object
- #solution_id ⇒ Object
- #status_code ⇒ Object
- #summary_errors ⇒ Object
- #summary_failed ⇒ Object
- #summary_passed ⇒ Object
- #timed_out ⇒ Object
- #valid ⇒ Object
- #wall_time ⇒ Object
Methods included from Common
Constructor Details
#initialize(options) ⇒ DeferredResponse
Returns a new instance of DeferredResponse.
5 6 7 8 9 10 11 12 13 14 |
# File 'lib/codewars_api/deferred_response.rb', line 5 def initialize() api_key = .delete!(:api_key) dmid = .delete!(:dmid) = {} = RequestHelper.add_api_key(, api_key) @response = RequestHelper.get("#{CodewarsApi::API_URL}/deferred/#{dmid}", ) ResponseChecker.check_errors(@response) end |
Instance Method Details
#dmid ⇒ Object
16 17 18 |
# File 'lib/codewars_api/deferred_response.rb', line 16 def dmid @response.to_h['dmid'] end |
#errors ⇒ Object
36 37 38 |
# File 'lib/codewars_api/deferred_response.rb', line 36 def errors @response.to_h['errors'] end |
#failed ⇒ Object
40 41 42 |
# File 'lib/codewars_api/deferred_response.rb', line 40 def failed @response.to_h['failed'] end |
#output ⇒ Object
60 61 62 |
# File 'lib/codewars_api/deferred_response.rb', line 60 def output @response.to_h['output'] end |
#passed ⇒ Object
32 33 34 |
# File 'lib/codewars_api/deferred_response.rb', line 32 def passed @response.to_h['passed'] end |
#server_error ⇒ Object
28 29 30 |
# File 'lib/codewars_api/deferred_response.rb', line 28 def server_error @response.to_h['server_error'] end |
#solution_id ⇒ Object
20 21 22 |
# File 'lib/codewars_api/deferred_response.rb', line 20 def solution_id @response.to_h['solution_id'] end |
#status_code ⇒ Object
68 69 70 |
# File 'lib/codewars_api/deferred_response.rb', line 68 def status_code @response.to_h['status_code'] end |
#summary_errors ⇒ Object
56 57 58 |
# File 'lib/codewars_api/deferred_response.rb', line 56 def summary_errors @response.to_h['summary'].andand['errors'] end |
#summary_failed ⇒ Object
52 53 54 |
# File 'lib/codewars_api/deferred_response.rb', line 52 def summary_failed @response.to_h['summary'].andand['failed'] end |
#summary_passed ⇒ Object
48 49 50 |
# File 'lib/codewars_api/deferred_response.rb', line 48 def summary_passed @response.to_h['summary'].andand['passed'] end |
#timed_out ⇒ Object
44 45 46 |
# File 'lib/codewars_api/deferred_response.rb', line 44 def timed_out @response.to_h['timed_out'] end |
#valid ⇒ Object
24 25 26 |
# File 'lib/codewars_api/deferred_response.rb', line 24 def valid @response.to_h['valid'] end |
#wall_time ⇒ Object
64 65 66 |
# File 'lib/codewars_api/deferred_response.rb', line 64 def wall_time @response.to_h['wall_time'] end |