Class: Tiltify::Challenge

Inherits:
Object
  • Object
show all
Defined in:
lib/tiltify/objects/challenge.rb

Instance Method Summary collapse

Methods inherited from Object

#to_ostruct

Constructor Details

#initialize(options = {}) ⇒ Challenge

Returns a new instance of Challenge.



4
5
6
7
8
9
10
# File 'lib/tiltify/objects/challenge.rb', line 4

def initialize(options = {})
  super options

  self.ends_at    = Time.at(options["endsAt"].to_s[0..-4].to_i) if options["endsAt"]
  self.created_at = Time.at(options["createdAt"].to_s[0..-4].to_i) if options["createdAt"]
  self.updated_at = Time.at(options["updatedAt"].to_s[0..-4].to_i) if options["updatedAt"]
end