Class: FinchAPI::Unknown Abstract Private

Inherits:
Object
  • Object
show all
Extended by:
Converter
Defined in:
lib/finch-api/base_model.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

This class is abstract.

When we don’t know what to expect for the value.

Class Method Summary collapse

Methods included from Converter

coerce, dump, try_strict_coerce, type_info

Class Method Details

.==(other) ⇒ Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Parameters:

  • other (Object)

Returns:

  • (Boolean)


193
# File 'lib/finch-api/base_model.rb', line 193

def self.==(other) = other.is_a?(Class) && other <= FinchAPI::Unknown

.===(other) ⇒ Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Parameters:

  • other (Object)

Returns:

  • (Boolean)


188
# File 'lib/finch-api/base_model.rb', line 188

def self.===(other) = true

.coerce(value) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Parameters:

  • value (Object)

Returns:

  • (Object)


6
# File 'lib/finch-api/base_model.rb', line 6

def coerce(value) = super

.dump(value) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Parameters:

  • value (Object)

Returns:

  • (Object)


6
# File 'lib/finch-api/base_model.rb', line 6

def dump(value) = super

.try_strict_coerce(value) ⇒ Array(true, Object, nil), Array(false, Boolean, Integer)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Parameters:

  • value (Object)

Returns:

  • (Array(true, Object, nil), Array(false, Boolean, Integer))


217
218
219
220
# File 'lib/finch-api/base_model.rb', line 217

def try_strict_coerce(value)
  # prevent unknown variant from being chosen during the first coercion pass
  [false, true, 0]
end