Class: CodeforcesAPI::Object::Problem

Inherits:
Object
  • Object
show all
Defined in:
lib/codeforces_api/object/problem.rb

Constant Summary collapse

ATTRS =
[
  :contestId,
  :index,
  :name,
  :type,
  :points,
  :tags,
].freeze

Instance Method Summary collapse

Constructor Details

#initialize(prob) ⇒ Problem

Returns a new instance of Problem.



15
16
17
# File 'lib/codeforces_api/object/problem.rb', line 15

def initialize prob
  ATTRS.each { |attr| instance_variable_set("@#{attr}", prob[attr.to_s]) }
end