Module: ApiResource::Typecast::UnknownTypecaster

Defined in:
lib/api_resource/typecasters/unknown_typecaster.rb

Overview

The unknown typecaster which does not modify the value of the attribute in either direction. Keeps the interface consistent for unspecified typecasters

Class Method Summary collapse

Class Method Details

.from_api(value) ⇒ Object

Just returns what was passed in

Parameters:

  • value (Object)

    The value to typecast

Returns:

  • (Object)

    An unmodified value



18
19
20
# File 'lib/api_resource/typecasters/unknown_typecaster.rb', line 18

def self.from_api(value)
  return value
end

.to_api(value) ⇒ Object

Just returns what was passed in

Parameters:

  • value (Object)

    The value to typecast

Returns:

  • (Object)

    An unmodified value



27
28
29
# File 'lib/api_resource/typecasters/unknown_typecaster.rb', line 27

def self.to_api(value)
  return value
end