summaryrefslogtreecommitdiff
path: root/spec/rubyspec/core/float/fixtures/coerce.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/rubyspec/core/float/fixtures/coerce.rb')
-rw-r--r--spec/rubyspec/core/float/fixtures/coerce.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/rubyspec/core/float/fixtures/coerce.rb b/spec/rubyspec/core/float/fixtures/coerce.rb
new file mode 100644
index 0000000000..2cf155be95
--- /dev/null
+++ b/spec/rubyspec/core/float/fixtures/coerce.rb
@@ -0,0 +1,15 @@
+module FloatSpecs
+ class CanCoerce
+ def initialize(a)
+ @a = a
+ end
+
+ def coerce(b)
+ [self.class.new(b), @a]
+ end
+
+ def /(b)
+ @a.to_i % b.to_i
+ end
+ end
+end