diff options
Diffstat (limited to 'spec/ruby/core/float/fixtures/coerce.rb')
-rw-r--r-- | spec/ruby/core/float/fixtures/coerce.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/ruby/core/float/fixtures/coerce.rb b/spec/ruby/core/float/fixtures/coerce.rb new file mode 100644 index 0000000000..2cf155be95 --- /dev/null +++ b/spec/ruby/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 |