Module: WolfCore::Barton::Mappings
- Includes:
- ExceptionOperations
- Defined in:
- lib/wolf_core/application/barton/mappings.rb
Instance Method Summary collapse
- #map_pricing_id_to_provider_type(pricing_id) ⇒ Object
- #map_provider_type_to_pricing_id(provider_type) ⇒ Object
Methods included from ExceptionOperations
Instance Method Details
#map_pricing_id_to_provider_type(pricing_id) ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/wolf_core/application/barton/mappings.rb', line 23 def map_pricing_id_to_provider_type(pricing_id) case pricing_id.to_s when ENV['MD_PRICING_ID'] 'MD' when ENV['DO_PRICING_ID'] 'DO' when ENV['PA_PRICING_ID'] 'PA' when ENV['DMD_PRICING_ID'] 'DMD' when ENV['NP_PRICING_ID'] 'NP' else raise_service_error({ message: "Unknown provider type #{provider_type}" }) end end |
#map_provider_type_to_pricing_id(provider_type) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/wolf_core/application/barton/mappings.rb', line 6 def map_provider_type_to_pricing_id(provider_type) case provider_type when 'MD' ENV['MD_PRICING_ID'] when 'DO' ENV['DO_PRICING_ID'] when 'PA' ENV['PA_PRICING_ID'] when 'DMD' ENV['DMD_PRICING_ID'] when 'NP' ENV['NP_PRICING_ID'] else raise_service_error({ message: "Unknown provider type #{provider_type}" }) end end |