Method: Origami::Real#initialize

Defined in:
lib/origami/numeric.rb

#initialize(f = 0) ⇒ Real

Creates a new Real from a Ruby Float.

f

The new Real value.



150
151
152
153
154
155
156
# File 'lib/origami/numeric.rb', line 150

def initialize(f = 0)
    unless f.is_a?(Float)
        raise TypeError, "Expected type Float, received #{f.class}."
    end

    super(f)
end