Class: ArithmeticCalculator
- Inherits:
-
Object
- Object
- ArithmeticCalculator
- Defined in:
- lib/arithmetic_calculator.rb
Class Method Summary collapse
- .add(n1, n2) ⇒ Object
- .divide(n1, n2) ⇒ Object
- .multiply(n1, n2) ⇒ Object
- .subtract(n1, n2) ⇒ Object
Class Method Details
.add(n1, n2) ⇒ Object
2 3 4 |
# File 'lib/arithmetic_calculator.rb', line 2 def self.add(n1,n2) result = n1 + n2 end |
.divide(n1, n2) ⇒ Object
11 12 13 |
# File 'lib/arithmetic_calculator.rb', line 11 def self.divide(n1,n2) result = n1 / n2 end |
.multiply(n1, n2) ⇒ Object
8 9 10 |
# File 'lib/arithmetic_calculator.rb', line 8 def self.multiply(n1,n2) result = n1 * n2 end |
.subtract(n1, n2) ⇒ Object
5 6 7 |
# File 'lib/arithmetic_calculator.rb', line 5 def self.subtract(n1,n2) result = n1 - n2 end |