module BinderSDK::Helpers

Constants

SDK_TO_SPI_MAPPINGS

Public Instance Methods

sdk_class_for(spi_type) click to toggle source
# File lib/binder_sdk/helpers.rb, line 5
def sdk_class_for(spi_type)
  sdk_type_for(spi_type).constantize
end
sdk_type_for(spi_type) click to toggle source
# File lib/binder_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
    "BinderSDK::#{spi_type.gsub("::", "")}"
  end
end
spi_type_for(sdk_type) click to toggle source
# File lib/binder_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("BinderSDK::", "")
  end
end