Module: MeducationSDK::Helpers
- Included in:
- PaypalPurchases, Purchases, Recommender, Recommender::UserRecommender, Resource
- Defined in:
- lib/meducation_sdk/helpers.rb
Constant Summary collapse
- SDK_TO_SPI_MAPPINGS =
{}
Instance Method Summary collapse
Instance Method Details
#sdk_class_for(spi_type) ⇒ Object
5 6 7 |
# File 'lib/meducation_sdk/helpers.rb', line 5 def sdk_class_for(spi_type) sdk_type_for(spi_type).constantize end |
#sdk_type_for(spi_type) ⇒ Object
9 10 11 12 13 14 15 |
# File 'lib/meducation_sdk/helpers.rb', line 9 def sdk_type_for(spi_type) if SDK_TO_SPI_MAPPINGS.has_value?(spi_type) SDK_TO_SPI_MAPPINGS.key(spi_type) else "MeducationSDK::#{spi_type.gsub("::", "")}" end end |
#spi_type_for(sdk_type) ⇒ Object
17 18 19 20 21 22 23 24 |
# File 'lib/meducation_sdk/helpers.rb', line 17 def spi_type_for(sdk_type) sdk_type = sdk_type.gsub(/Mock$/, "") if SDK_TO_SPI_MAPPINGS.has_key?(sdk_type) SDK_TO_SPI_MAPPINGS[sdk_type] else sdk_type.gsub("MeducationSDK::", "") end end |