class Gorillib::Factory::FloatFactory

Returns arg converted to a float.

@example

FloatFactory.receive(1)                     #=> 1.0
FloatFactory.receive("123.456")             #=> 123.456
FloatFactory.receive("0x1.999999999999ap-4" #=> 0.1

@example FloatFactory is strict in some cases where GraciousFloatFactory is not

FloatFactory.receive("1_23e9f")             #=> (error)

@example FloatFactory() is not as gullible as GraciousFloatFactory

FloatFactory.receive("7eleven")             #=> (error)
FloatFactory.receive("nonzero")             #=> (error)

Public Instance Methods

convert(obj) click to toggle source
# File lib/gorillib/model/factories.rb, line 361
def convert(obj) Float(obj) ; end