Class: Api::Vendor::V1::Klook::ProductSerializer
- Inherits:
-
BaseSerializer
- Object
- BaseSerializer
- Api::Vendor::V1::Klook::ProductSerializer
- Includes:
- Concerns::SerializerUtils
- Defined in:
- app/serializers/api/vendor/v1/klook/product_serializer.rb
Instance Attribute Summary collapse
-
#restaurant ⇒ Object
readonly
Returns the value of attribute restaurant.
Instance Method Summary collapse
- #as_json ⇒ Object
-
#initialize(restaurant) ⇒ ProductSerializer
constructor
A new instance of ProductSerializer.
Methods inherited from BaseSerializer
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
#restaurant ⇒ Object (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_json ⇒ Object
12 13 14 |
# File 'app/serializers/api/vendor/v1/klook/product_serializer.rb', line 12 def as_json(*) serialize_product(restaurant) end |