class Lithic::Internal::Type::IOLike

Either ‘Pathname` or `StringIO`.
@abstract
@api private

def self.==(other) = other.is_a?(Class) && other <= Lithic::Internal::Type::IOLike

Returns:
  • (Boolean) -

Parameters:
  • other (Object) --

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

def self.===(other)

Returns:
  • (Boolean) -

Parameters:
  • other (Object) --

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

def coerce(value, state:)

Returns:
  • (StringIO, Object) -

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

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
    exactness[:no] += 1
    value
  end
end