Sha256: 44b63f19da97e85e1b8483194891ae343c36f77755c009c22e9662bfb7fec43b

Contents?: true

Size: 557 Bytes

Versions: 14

Compression:

Stored size: 557 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)
      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-1.6.16 lib/meducation_sdk/helpers.rb
meducation_sdk-1.6.15 lib/meducation_sdk/helpers.rb
meducation_sdk-1.6.14 lib/meducation_sdk/helpers.rb
meducation_sdk-1.6.13 lib/meducation_sdk/helpers.rb
meducation_sdk-1.6.12 lib/meducation_sdk/helpers.rb
meducation_sdk-1.6.11 lib/meducation_sdk/helpers.rb
meducation_sdk-1.6.10 lib/meducation_sdk/helpers.rb
meducation_sdk-1.6.6 lib/meducation_sdk/helpers.rb
meducation_sdk-1.6.5 lib/meducation_sdk/helpers.rb
meducation_sdk-1.6.4 lib/meducation_sdk/helpers.rb
meducation_sdk-1.6.3 lib/meducation_sdk/helpers.rb
meducation_sdk-1.6.2 lib/meducation_sdk/helpers.rb
meducation_sdk-1.6.1 lib/meducation_sdk/helpers.rb
meducation_sdk-1.6.0 lib/meducation_sdk/helpers.rb