Class: ActiveAttr::Typecasting::ObjectTypecaster

Inherits:
Object
  • Object
show all
Defined in:
lib/active_attr/typecasting/object_typecaster.rb

Overview

A “null” typecaster to provide uniformity

Examples:

Usage

ObjectTypecaster.new.call("") #=> ""

Since:

  • 0.5.0

Instance Method Summary collapse

Instance Method Details

#call(value) ⇒ Object

Returns the original value unmodified

Examples:

Typecast an Object

typecaster.call(1) #=> 1

Parameters:

  • value (Object)

    The object to typecast

Returns:

  • (Object)

    Whatever you passed in

Since:

  • 0.5.0



20
21
22
# File 'lib/active_attr/typecasting/object_typecaster.rb', line 20

def call(value)
  value
end