Class: Float
Overview
Extensions to the Float class required by the fOOrth language system.
Class Method Summary collapse
-
.foorth_coerce(arg) ⇒ Object
Coerce the argument to match my type.
Instance Method Summary collapse
-
#foorth_coerce(arg) ⇒ Object
Coerce the argument to match my type.
Class Method Details
.foorth_coerce(arg) ⇒ Object
Coerce the argument to match my type.
9 10 11 12 13 |
# File 'lib/fOOrth/monkey_patch/float.rb', line 9 def self.foorth_coerce(arg) Float(arg) rescue error "F40: Cannot coerce a #{arg.foorth_name} to a Float instance" end |
Instance Method Details
#foorth_coerce(arg) ⇒ Object
Coerce the argument to match my type.
16 17 18 19 20 |
# File 'lib/fOOrth/monkey_patch/float.rb', line 16 def foorth_coerce(arg) Float(arg) rescue error "F40: Cannot coerce a #{arg.foorth_name} to a Float instance" end |