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 |
# 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}", ) end |
Instance Method Details
#dmid ⇒ Object
15 16 17 |
# File 'lib/codewars_api/deferred_response.rb', line 15 def dmid @response.to_h['dmid'] end |
#errors ⇒ Object
35 36 37 |
# File 'lib/codewars_api/deferred_response.rb', line 35 def errors @response.to_h['errors'] end |
#failed ⇒ Object
39 40 41 |
# File 'lib/codewars_api/deferred_response.rb', line 39 def failed @response.to_h['failed'] end |
#output ⇒ Object
59 60 61 |
# File 'lib/codewars_api/deferred_response.rb', line 59 def output @response.to_h['output'] end |
#passed ⇒ Object
31 32 33 |
# File 'lib/codewars_api/deferred_response.rb', line 31 def passed @response.to_h['passed'] end |
#server_error ⇒ Object
27 28 29 |
# File 'lib/codewars_api/deferred_response.rb', line 27 def server_error @response.to_h['server_error'] end |
#solution_id ⇒ Object
19 20 21 |
# File 'lib/codewars_api/deferred_response.rb', line 19 def solution_id @response.to_h['solution_id'] end |
#status_code ⇒ Object
67 68 69 |
# File 'lib/codewars_api/deferred_response.rb', line 67 def status_code @response.to_h['status_code'] end |
#summary_errors ⇒ Object
55 56 57 |
# File 'lib/codewars_api/deferred_response.rb', line 55 def summary_errors @response.to_h['summary'].andand['errors'] end |
#summary_failed ⇒ Object
51 52 53 |
# File 'lib/codewars_api/deferred_response.rb', line 51 def summary_failed @response.to_h['summary'].andand['failed'] end |
#summary_passed ⇒ Object
47 48 49 |
# File 'lib/codewars_api/deferred_response.rb', line 47 def summary_passed @response.to_h['summary'].andand['passed'] end |
#timed_out ⇒ Object
43 44 45 |
# File 'lib/codewars_api/deferred_response.rb', line 43 def timed_out @response.to_h['timed_out'] end |
#valid ⇒ Object
23 24 25 |
# File 'lib/codewars_api/deferred_response.rb', line 23 def valid @response.to_h['valid'] end |
#wall_time ⇒ Object
63 64 65 |
# File 'lib/codewars_api/deferred_response.rb', line 63 def wall_time @response.to_h['wall_time'] end |