Class: CodeforcesAPI::Object::Hack
- Inherits:
-
Object
- Object
- CodeforcesAPI::Object::Hack
- Defined in:
- lib/codeforces_api/object/hack.rb
Constant Summary collapse
- ATTRS =
[ :id, :creationTimeSeconds, :hacker, :defender, :verdict, :problem, :test, :judgeProtocol, ].freeze
Instance Method Summary collapse
-
#initialize(hack) ⇒ Hack
constructor
A new instance of Hack.
Constructor Details
#initialize(hack) ⇒ Hack
Returns a new instance of Hack.
17 18 19 20 21 22 |
# File 'lib/codeforces_api/object/hack.rb', line 17 def initialize hack ATTRS.each { |attr| instance_variable_set("@#{attr}", hack[attr.to_s]) } @hacker = Party.new(@hacker) if @hacker @defender = Party.new(@defender) if @defender @problem = Problem.new(@problem) if @problem end |