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 32
32:     def typecast_value_decimal(value)
33:       if value.is_a?(String)
34:         BigDecimal.new(value)
35:       else
36:         super
37:       end
38:     end

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

[Source]

    # File lib/sequel/extensions/looser_typecasting.rb, line 16
16:     def typecast_value_float(value)
17:       value.to_f
18:     end

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

[Source]

    # File lib/sequel/extensions/looser_typecasting.rb, line 21
21:     def typecast_value_integer(value)
22:       value.to_i
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_string(value)
27:       value.to_s
28:     end

[Validate]