Class: CodewarsApi::FinalizeSolution

Inherits:
Object
  • Object
show all
Includes:
Common
Defined in:
lib/codewars_api/finalize_solution.rb

Instance Method Summary collapse

Methods included from Common

#reason, #success, #to_h

Constructor Details

#initialize(options) ⇒ FinalizeSolution

Returns a new instance of FinalizeSolution.



5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/codewars_api/finalize_solution.rb', line 5

def initialize(options)
  api_key = options.delete!(:api_key)
  project_id = options.delete!(:project_id)
  solution_id = options.delete!(:solution_id)

  request_options = {}
  request_options = RequestHelper.add_api_key(request_options, api_key)

  @response = RequestHelper.post(
    "#{CodewarsApi::API_URL}"\
    "/code-challenges/projects/#{project_id}/solutions/#{solution_id}/finalize",
    request_options
  )
end