Class: BasicCalculator

Inherits:
Object
  • Object
show all
Defined in:
lib/basic_calculator.rb

Class Method Summary collapse

Class Method Details

.add(a, b) ⇒ Object



2
3
4
5
6
7
8
# 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

.multiply(a, b) ⇒ Object



18
19
20
21
22
23
24
# 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) ⇒ Object



10
11
12
13
14
15
16
# 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