Class: CharterPriceSerializer
- Inherits:
-
AbstractSerializer
- Object
- AbstractSerializer
- CharterPriceSerializer
- Defined in:
- app/serializers/charter_price_serializer.rb
Class Method Summary collapse
Methods inherited from AbstractSerializer
Class Method Details
.available_attributes ⇒ Object
4 5 6 |
# File 'app/serializers/charter_price_serializer.rb', line 4 def available_attributes %i[currency value] end |
.currency(charter_price) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 |
# File 'app/serializers/charter_price_serializer.rb', line 8 def currency(charter_price) currency = ::Dicts::Currency.find(charter_price.currency_id) { currency: { id: currency.id, index: currency.index, symbol: currency.symbol } } end |
.value(charter_price) ⇒ Object
20 21 22 |
# File 'app/serializers/charter_price_serializer.rb', line 20 def value(charter_price) { value: sprintf('%d', charter_price.value) } end |