Class: Codeforces::Api

Inherits:
Object
  • Object
show all
Defined in:
lib/codeforces/api.rb,
lib/codeforces/api/user.rb,
lib/codeforces/api/contest.rb,
lib/codeforces/api/problem_set.rb

Defined Under Namespace

Classes: Contest, ProblemSet, User

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(new_client) ⇒ Api

Returns a new instance of Api.



9
10
11
# File 'lib/codeforces/api.rb', line 9

def initialize(new_client)
  @client = new_client
end

Instance Attribute Details

#clientObject (readonly)

Returns the value of attribute client.



7
8
9
# File 'lib/codeforces/api.rb', line 7

def client
  @client
end

Instance Method Details

#contestObject



13
14
15
# File 'lib/codeforces/api.rb', line 13

def contest
  @contest ||= ::Codeforces::Api::Contest.new(client)
end

#problemsetObject



17
18
19
# File 'lib/codeforces/api.rb', line 17

def problemset
  @problem_set ||= ::Codeforces::Api::ProblemSet.new(client)
end

#userObject



21
22
23
# File 'lib/codeforces/api.rb', line 21

def user
  @user ||= ::Codeforces::Api::User.new(client)
end