Class: CodewarsApi::AttemptSolution
- Inherits:
-
Object
- Object
- CodewarsApi::AttemptSolution
- Includes:
- Common
- Defined in:
- lib/codewars_api/attempt_solution.rb
Instance Method Summary collapse
- #dmid ⇒ Object
-
#initialize(options) ⇒ AttemptSolution
constructor
A new instance of AttemptSolution.
Methods included from Common
Constructor Details
#initialize(options) ⇒ AttemptSolution
Returns a new instance of AttemptSolution.
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/codewars_api/attempt_solution.rb', line 5 def initialize() api_key = .delete!(:api_key) project_id = .delete!(:project_id) solution_id = .delete!(:solution_id) = {} = RequestHelper.add_api_key(, api_key) = RequestHelper.(, ) @response = RequestHelper.post( "#{CodewarsApi::API_URL}"\ "/code-challenges/projects/#{project_id}/solutions/#{solution_id}/attempt", ) end |
Instance Method Details
#dmid ⇒ Object
21 22 23 |
# File 'lib/codewars_api/attempt_solution.rb', line 21 def dmid @response.to_h['dmid'] end |