class BasicCalculator

Public Class Methods

add(a,b) click to toggle source
# File lib/basic_calculator.rb, line 2
def self.add(a,b)
        begin
                return a + b
        rescue Exception => e
                puts "Something went wrong. #{e}"
        end
end
devide(a,b) click to toggle source
# File lib/basic_calculator.rb, line 26
def self.devide(a,b)
        begin
                return a/b
        rescue Exception => e
                "Something went wrong. #{e}"
        end
end
multiply(a,b) click to toggle source
# File lib/basic_calculator.rb, line 18
def self.multiply(a,b)
        begin
                return a*b
        rescue Exception => e
                "Something went wrong. #{e}"
        end
end
subtract(a,b) click to toggle source
# File lib/basic_calculator.rb, line 10
def self.subtract(a,b)
        begin
                return a-b
        rescue Exception => e
                puts "Something went wrong. #{e}"
        end
end