Class: Tiltify::Campaign

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

Instance Method Summary collapse

Methods inherited from Object

#to_ostruct

Constructor Details

#initialize(options = {}) ⇒ Campaign

Returns a new instance of Campaign.



4
5
6
7
8
9
# File 'lib/tiltify/objects/campaign.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