mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
16 lines
191 B
Ruby
16 lines
191 B
Ruby
|
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
|