I want to be able to do calculations like
Code:
puts 10.toKilos; puts 10.2.toKilos
I tried this... It does not work
Code:
module Weights
   def toKilos
     self*2.2
   end       
   
   def toLbs
     self / 2.2
   end
   
end

class Fixnums
   include Weights
end

class Float
   include Weights
end

puts 10.toKilos
I can put a method definition in both class Fixnum and class Float to get this functionality. How do I use mixins to get the same functionality