Module Sequel::LooserTypecasting
In: lib/sequel/extensions/looser_typecasting.rb

Methods

Public Instance methods

Typecast the value to a BigDecimal, without checking if strings have a valid format.

[Source]

    # File lib/sequel/extensions/looser_typecasting.rb, line 37
37:     def typecast_value_decimal(value)
38:       if value.is_a?(String)
39:         BigDecimal.new(value)
40:       else
41:         super
42:       end
43:     end

Typecast the value to a Float using to_f instead of Kernel.Float

[Source]

    # File lib/sequel/extensions/looser_typecasting.rb, line 21
21:     def typecast_value_float(value)
22:       value.to_f
23:     end

Typecast the value to an Integer using to_i instead of Kernel.Integer

[Source]

    # File lib/sequel/extensions/looser_typecasting.rb, line 26
26:     def typecast_value_integer(value)
27:       value.to_i
28:     end

Typecast the value to an String using to_s instead of Kernel.String

[Source]

    # File lib/sequel/extensions/looser_typecasting.rb, line 31
31:     def typecast_value_string(value)
32:       value.to_s
33:     end

[Validate]