title: Ruby overloading operators with severals parameters
body: <p>I have a class MoneyBox with two fields (wallet and cent). I need to overload operations +, -, and * with these fields. How to correctly implement the overloading of these operators with two parameters?</p>
  <pre><code>class MoneyBox
    attr_accessor :wallet, :cent
  
    def initialize(wallet, cent)
    @wallet = wallet  
    @cent = cent 
     
    end
  
    def + (obj, obj_cent)
      self.wallet = self.wallet + obj.wallet
      self.cent = self.cent + obj_cent.cent
      return self.wallet, self.cent 
    end
  
    def - (obj, obj_cent) 
      self.wallet = self.wallet - obj.wallet
      self.cent = self.cent - obj_cent.cent
      return self.wallet, self.cent 
    end
  
    def * (obj,obj_cent) 
      self.wallet = self.wallet * obj.wallet
      self.cent = self.cent * obj_cent
      return self.wallet, self.cent 
    end
  
  end
  
  </code></pre>
  <p>It should be something like this:</p>
  <pre><code>Cash1 = MoneyBox.new(500, 30)
  Cash2 = MoneyBox.new(100, 15)
  
  puts &quot; D1 = #{D1 = (Cash1-(Cash2*2))}&quot; # 500,30 - 100,15*2 = 300,0
  </code></pre>