Class: Tiltify::Schedule

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

Instance Method Summary collapse

Methods inherited from Object

#to_ostruct

Constructor Details

#initialize(options = {}) ⇒ Schedule

Returns a new instance of Schedule.



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

def initialize(options = {})
  super options

  self.starts_at = Time.at(options["startsAt"].to_s[0..-4].to_i) if options["startsAt"]
  self.ends_at   = Time.at(options["endsAt"].to_s[0..-4].to_i) if options["endsAt"]
end