Sha256: aa40baaec18178243545463991668e87ae3b30d0072980b9ddb44552d2237987

Contents?: true

Size: 601 Bytes

Versions: 14

Compression:

Stored size: 601 Bytes

Contents

module MeducationSDK
  module Helpers
    SDK_TO_SPI_MAPPINGS = {}

    def sdk_class_for(spi_type)
      sdk_type_for(spi_type).constantize
    end

    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

    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
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
meducation_sdk-2.2.2 lib/meducation_sdk/helpers.rb
meducation_sdk-2.2.1 lib/meducation_sdk/helpers.rb
meducation_sdk-2.2.0 lib/meducation_sdk/helpers.rb
meducation_sdk-2.1.4 lib/meducation_sdk/helpers.rb
meducation_sdk-2.1.3 lib/meducation_sdk/helpers.rb
meducation_sdk-2.1.2 lib/meducation_sdk/helpers.rb
meducation_sdk-2.1.1 lib/meducation_sdk/helpers.rb
meducation_sdk-2.1.0 lib/meducation_sdk/helpers.rb
meducation_sdk-2.0.5 lib/meducation_sdk/helpers.rb
meducation_sdk-2.0.4 lib/meducation_sdk/helpers.rb
meducation_sdk-2.0.3 lib/meducation_sdk/helpers.rb
meducation_sdk-2.0.2 lib/meducation_sdk/helpers.rb
meducation_sdk-2.0.1 lib/meducation_sdk/helpers.rb
meducation_sdk-2.0.0 lib/meducation_sdk/helpers.rb