Module: SpreeCmCommissioner::ServiceType
- Extended by:
- ActiveSupport::Concern
- Defined in:
- app/models/concerns/spree_cm_commissioner/service_type.rb
Constant Summary collapse
- SERVICE_TYPES =
i[organizer transit intercity_taxi].freeze
Class Method Summary collapse
-
.translated_service_types ⇒ Object
Returns a hash of all service types with their translated names Example: { organizer: “Organizer”, transit: “Transit”, intercity_taxi: “Intercity Taxi” }.
Class Method Details
.translated_service_types ⇒ Object
Returns a hash of all service types with their translated names Example: { organizer: “Organizer”, transit: “Transit”, intercity_taxi: “Intercity Taxi” }
Usage: SpreeCmCommissioner::ServiceType.translated_service_types
26 27 28 29 30 31 32 33 |
# File 'app/models/concerns/spree_cm_commissioner/service_type.rb', line 26 def self.translated_service_types SERVICE_TYPES.index_with do |type| I18n.t("service_types.#{type}", scope: 'spree', default: type.to_s.humanize ) end end |