class OnebusawaySDK::Internal::Type::FileInput

not rewindable.
Note: when ‘IO` is used, all retries are disabled, since many IO` streams are
`OnebusawaySDK::Internal::Type::FileInput`.
Either `Pathname` or `StringIO`, or `IO`, or
@abstract
@api private

def self.==(other) = other.is_a?(Class) && other <= OnebusawaySDK::Internal::Type::FileInput

Returns:
  • (Boolean) -

Parameters:
  • other (Object) --

Other tags:
    Api: - public
def self.==(other) = other.is_a?(Class) && other <= OnebusawaySDK::Internal::Type::FileInput

def self.===(other)

Returns:
  • (Boolean) -

Parameters:
  • other (Object) --

Other tags:
    Api: - public
def self.===(other)
  case other
  in Pathname | StringIO | IO | String | OnebusawaySDK::FilePart
    true
  else
    false
  end
end

def coerce(value, state:)

Returns:
  • (StringIO, Object) -

Options Hash: (**state)
  • :branched (Integer) --
  • :error (Class) --
  • :exactness (Hash{Symbol=>Object}) --
  • :strictness (Boolean) --
  • :translate_names (Boolean) --

Parameters:
  • state (Hash{Symbol=>Object}) -- .
  • value (StringIO, String, Object) --

Other tags:
    Api: - private
def coerce(value, state:)
  exactness = state.fetch(:exactness)
  case value
  in String
    exactness[:yes] += 1
    StringIO.new(value)
  in StringIO
    exactness[:yes] += 1
    value
  else
    state[:error] = TypeError.new("#{value.class} can't be coerced into #{StringIO}")
    exactness[:no] += 1
    value
  end
end

def dump(value, state:)

Returns:
  • (Pathname, StringIO, IO, String, Object) -

Options Hash: (**state)
  • :can_retry (Boolean) --

Parameters:
  • state (Hash{Symbol=>Object}) -- .
  • value (Pathname, StringIO, IO, String, Object) --

Other tags:
    Api: - private
def dump(value, state:)
  # rubocop:disable Lint/DuplicateBranch
  case value
  in IO
    state[:can_retry] = false
  in OnebusawaySDK::FilePart if value.content.is_a?(IO)
    state[:can_retry] = false
  else
  end
  # rubocop:enable Lint/DuplicateBranch
  value
end

def to_sorbet_type

Returns:
  • (Object) -

Other tags:
    Api: - private
def to_sorbet_type
  T.any(Pathname, StringIO, IO, String, OnebusawaySDK::FilePart)
end