module OnebusawaySDK::Internal::Util::SorbetRuntimeSupport

def const_missing(name)

Parameters:
  • name (Symbol) --

Other tags:
    Api: - private
def const_missing(name)
  super unless sorbet_runtime_constants.key?(name)
  unless Object.const_defined?(:T)
    message = "Trying to access a Sorbet constant #{name.inspect} without `sorbet-runtime`."
    raise MissingSorbetRuntimeError.new(message)
  end
  sorbet_runtime_constants.fetch(name).call
end

def define_sorbet_constant!(name, &blk) = sorbet_runtime_constants.store(name, blk)

Parameters:
  • blk (Proc) --
  • name (Symbol) --

Other tags:
    Api: - private
def define_sorbet_constant!(name, &blk) = sorbet_runtime_constants.store(name, blk)

def sorbet_constant_defined?(name) = sorbet_runtime_constants.key?(name)

Returns:
  • (Boolean) -

Parameters:
  • name (Symbol) --

Other tags:
    Api: - private
def sorbet_constant_defined?(name) = sorbet_runtime_constants.key?(name)

def sorbet_runtime_constants = @sorbet_runtime_constants ||= {}

Returns:
  • (Hash{Symbol=>Object}) -

Other tags:
    Api: - private
def sorbet_runtime_constants = @sorbet_runtime_constants ||= {}

def to_sorbet_type = raise NotImplementedError

Returns:
  • (Object) -

Other tags:
    Api: - private
def to_sorbet_type = raise NotImplementedError

def to_sorbet_type(type)

Returns:
  • (Object) -

Parameters:
  • type (OnebusawaySDK::Internal::Util::SorbetRuntimeSupport, Object) --

Other tags:
    Api: - private
def to_sorbet_type(type)
  case type
  in OnebusawaySDK::Internal::Util::SorbetRuntimeSupport
    type.to_sorbet_type
  in Class | Module
    type
  in true | false
    T::Boolean
  else
    type.class
  end
end