Class: Api::Vendor::V1::Klook::ProductSerializer

Inherits:
BaseSerializer show all
Includes:
Concerns::SerializerUtils
Defined in:
app/serializers/api/vendor/v1/klook/product_serializer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from BaseSerializer

enable_caching

Constructor Details

#initialize(restaurant) ⇒ ProductSerializer

Returns a new instance of ProductSerializer.



7
8
9
10
# File 'app/serializers/api/vendor/v1/klook/product_serializer.rb', line 7

def initialize(restaurant)
  super()
  @restaurant = restaurant
end

Instance Attribute Details

#restaurantObject (readonly)

Returns the value of attribute restaurant.



5
6
7
# File 'app/serializers/api/vendor/v1/klook/product_serializer.rb', line 5

def restaurant
  @restaurant
end

Instance Method Details

#as_jsonObject



12
13
14
# File 'app/serializers/api/vendor/v1/klook/product_serializer.rb', line 12

def as_json(*)
  serialize_product(restaurant)
end