Sha256: 856ce6e4862612837f7e14d042d135b2e6119d7ceafc7af3a2cb899c0bed756b

Contents?: true

Size: 817 Bytes

Versions: 9

Compression:

Stored size: 817 Bytes

Contents

module Logistics
  module Core
    class KilogramMinimumRateSerializer < ActiveModel::Serializer
      attributes :id, :service_delivery_unit_id, :service_delivery_unit_name, :chargeable_service_id,
                 :chargeable_service_name, :transaction_type_id, :transaction_type_name,
                 :minimum_price

      def service_delivery_unit_id
        object.chargeable_service_unit_of_charge&.service_delivery_unit_id
      end

      def service_delivery_unit_name
        object.chargeable_service_unit_of_charge&.service_delivery_unit.name
      end

      def chargeable_service_id
        object.chargeable_service_unit_of_charge&.chargeable_service_id
      end

      def chargeable_service_name
        object.chargeable_service_unit_of_charge&.chargeable_service.name
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
logistics_core-21.11.2 app/serializers/logistics/core/kilogram_minimum_rate_serializer.rb
logistics_core-21.11.1 app/serializers/logistics/core/kilogram_minimum_rate_serializer.rb
logistics_core-21.08.1 app/serializers/logistics/core/kilogram_minimum_rate_serializer.rb
logistics_core-21.03.1 app/serializers/logistics/core/kilogram_minimum_rate_serializer.rb
logistics_core-20.10.3 app/serializers/logistics/core/kilogram_minimum_rate_serializer.rb
logistics_core-20.10.2 app/serializers/logistics/core/kilogram_minimum_rate_serializer.rb
logistics_core-20.10.1 app/serializers/logistics/core/kilogram_minimum_rate_serializer.rb
logistics_core-20.9.1 app/serializers/logistics/core/kilogram_minimum_rate_serializer.rb
logistics_core-20.8.1 app/serializers/logistics/core/kilogram_minimum_rate_serializer.rb