Class: AdaptivePointsSerializer
Overview
typed: ignore frozen_string_literal: true
Instance Method Summary
collapse
decorate_attributes, decorator, #object_cache_key
Instance Method Details
#created_at ⇒ Object
15
16
17
|
# File 'app/serializers/adaptive_points_serializer.rb', line 15
def created_at
"#{object&.created_at&.strftime('%Y-%m-%d')}"
end
|
#end_date ⇒ Object
11
12
13
|
# File 'app/serializers/adaptive_points_serializer.rb', line 11
def end_date
"#{object&.end_date&.strftime('%Y-%m-%d')}" || ''
end
|
#resto_group_tag ⇒ Object
19
20
21
22
23
24
25
26
27
|
# File 'app/serializers/adaptive_points_serializer.rb', line 19
def resto_group_tag
if object.campaign_type == 'Restaurant'
object.campaign.name
elsif object.campaign_type == 'RestaurantGroup'
object.campaign.name
elsif object.campaign_type == 'RestaurantTag'
object.campaign.title
end
end
|
#start_date ⇒ Object
7
8
9
|
# File 'app/serializers/adaptive_points_serializer.rb', line 7
def start_date
"#{object.start_date.strftime('%Y-%m-%d')}"
end
|