Method: FastAttributes::TypeCast#initialize

Defined in:
lib/fast_attributes/type_cast.rb

#initialize(type) ⇒ TypeCast

Returns a new instance of TypeCast.



9
10
11
12
13
14
15
# File 'lib/fast_attributes/type_cast.rb', line 9

def initialize(type)
  @type              = type
  @if_conditions     = []
  @else_condition    = %q(raise FastAttributes::TypeCast::UnknownTypeCastingError, 'Type casting is not defined')
  @rescue_conditions = nil
  @default_rescue    = %(raise FastAttributes::TypeCast::InvalidValueError, %(Invalid value "\#{%s}" for attribute "%a" of type "#{@type}"))
end