Class: Codeforces::Models::Submission

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

Instance Attribute Summary collapse

Attributes inherited from Base

#base, #client

Instance Method Summary collapse

Methods inherited from Base

#grep, #invert_grep

Constructor Details

#initialize(client, base) ⇒ Submission

Returns a new instance of Submission.



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

def initialize(client, base)
  super
  @user_id = base.author.members.first.handle
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Codeforces::Models::Base

Instance Attribute Details

#user_idObject (readonly)

Returns the value of attribute user_id.



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

def user_id
  @user_id
end

Instance Method Details

#userObject



12
13
14
# File 'lib/codeforces/models/submission.rb', line 12

def user
  client.send(:user, user_id)
end