{"record":{"id":"e4d2c0bf147eb5c6","repo":"RubyMoney/money","slug":"can-t-multiply-a-self-class-name-by-a-other-c","errorCode":null,"errorMessage":"Can't multiply a #{self.class.name} by a #{other.class.name}'s value","messagePattern":"Can't multiply a #(.+?) by a #(.+?)'s value","errorType":"exception","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"lib/money/money/arithmetic.rb","lineNumber":185,"sourceCode":"    # +Money+ object with this monetary value and the same currency.\n    #\n    # Note that you can't multiply a Money object by an other +Money+ object.\n    #\n    # @param [Numeric] value Number to multiply by.\n    #\n    # @return [Money] The resulting money.\n    #\n    # @raise [TypeError] If +value+ is NOT a number.\n    #\n    # @example\n    #   Money.new(100) * 2 #=> #<Money @fractional=200>\n    #\n    def *(other)\n      other = other.value if other.is_a?(CoercedNumeric)\n      if other.is_a? Numeric\n        dup_with(fractional: fractional * other)\n      else\n        raise TypeError, \"Can't multiply a #{self.class.name} by a #{other.class.name}'s value\"\n      end\n    end\n\n    # Divides the monetary value with the given number and returns a new +Money+\n    # object with this monetary value and the same currency.\n    # Can also divide by another +Money+ object to get a ratio.\n    #\n    # +Money/Numeric+ returns +Money+. +Money/Money+ returns +Float+.\n    #\n    # @param [Money, Numeric] value Number to divide by.\n    #\n    # @return [Money] The resulting money if you divide Money by a number.\n    # @return [Float] The resulting number if you divide Money by a Money.\n    #\n    # @example\n    #   Money.new(100) / 10            #=> #<Money @fractional=10>\n    #   Money.new(100) / Money.new(10) #=> 10.0\n    #","sourceCodeStart":167,"sourceCodeEnd":203,"githubUrl":"https://github.com/RubyMoney/money/blob/26e2829c34f165847040a5a40d4d2daa5eb72927/lib/money/money/arithmetic.rb#L167-L203","documentation":"Error \"Can't multiply a #{self.class.name} by a #{other.class.name}'s value\" thrown in RubyMoney/money.","triggerScenarios":"Thrown at lib/money/money/arithmetic.rb:185 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"26e2829c34f165847040a5a40d4d2daa5eb72927","analyzedAt":"2026-08-23T17:41:07.306Z","schemaVersion":2},"datasetVersion":"2026-08-23T21:17:23.414Z"}