sh19910711/codeforces-api.rb

View on GitHub
lib/codeforces/models/problems.rb

Summary

Maintainability
A
0 mins
Test Coverage
module Codeforces::Models

  class Problems < Base

    def initialize(new_client, new_base)
      super new_client, new_base
      @contest = {}
      new_base.each do |problem|
        @contest[problem.contestId] ||= []
        @contest[problem.contestId].push problem
      end
    end

    def contest(id)
      @contest[id] ||= []
      self.class.new client, @contest[id]
    end

  end

end