module CalcAd

comment for rubocop only

Constants

VERSION

Public Class Methods

addition(first_operand, second_operand) click to toggle source
# File lib/calc_ad.rb, line 6
def self.addition(first_operand, second_operand)
  first_operand + second_operand
end
division(first_operand, second_operand) click to toggle source
# File lib/calc_ad.rb, line 18
def self.division(first_operand, second_operand)
  return 'Dividing by zero is forbidden' if second_operand.zero?
  (first_operand / second_operand.to_f).round 2
end
multiply(first_operand, second_operand) click to toggle source
# File lib/calc_ad.rb, line 14
def self.multiply(first_operand, second_operand)
  (first_operand * second_operand).round 2
end
substraction(first_operand, second_operand) click to toggle source
# File lib/calc_ad.rb, line 10
def self.substraction(first_operand, second_operand)
  first_operand - second_operand
end