Class: V1::AdvertisementSerializer

Inherits:
ActiveModel::Serializer
  • Object
show all
Defined in:
app/serializers/v1/advertisement_serializer.rb

Instance Method Summary collapse

Instance Method Details

#ended_atObject



22
23
24
# File 'app/serializers/v1/advertisement_serializer.rb', line 22

def ended_at
  object.ended_at.to_i
end

#image_urlObject



26
27
28
# File 'app/serializers/v1/advertisement_serializer.rb', line 26

def image_url
  object.cover_url(instance_options[:size])
end

#slot_idObject



14
15
16
# File 'app/serializers/v1/advertisement_serializer.rb', line 14

def slot_id
  object.slot.uuid
end

#started_atObject



18
19
20
# File 'app/serializers/v1/advertisement_serializer.rb', line 18

def started_at
  object.started_at.to_i
end