Class: Codeforces::Models::User

Inherits:
Base
  • Object
show all
Defined in:
lib/codeforces/models/user.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#client

Instance Method Summary collapse

Constructor Details

#initialize(client, base_user) ⇒ User

Returns a new instance of User.



7
8
9
10
11
# File 'lib/codeforces/models/user.rb', line 7

def initialize(client, base_user)
  super(client)

  @user = base_user
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args, &block) ⇒ Object (private)



19
20
21
# File 'lib/codeforces/models/user.rb', line 19

def method_missing(method, *args, &block)
  user.send method, *args, &block
end

Instance Attribute Details

#userObject (readonly)

Returns the value of attribute user.



5
6
7
# File 'lib/codeforces/models/user.rb', line 5

def user
  @user
end

Instance Method Details

#submissionsObject



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

def submissions
  client.api.user.status(user.handle)
end