calculator_demo 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/calculator_demo.rb +22 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 70aeb7fb0c7433ff7925888a61f92432de9ae8c248b0e0354e10c541d9be9d5e
|
|
4
|
+
data.tar.gz: 5cac6ea47818a7898f734468a4ee2645f325431f1b2f4204213d1d185454470c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 16fd1488add79b1e60abc2cfe6e80a281689ddae6ab2f675fb731dc71da524db252fb18f55cb27c67ee560f698ff8c7135af8d38ad794e5a5b905305120dca75
|
|
7
|
+
data.tar.gz: 4a67bcc23d2d7c1ce6ed0f414951b3c0b3a2a8a18c31007458ef4b4b48e73d5aa29d151c2256f369f2c77e7b9f236b85a19b96015a5069bf6de6d8f463267bce
|
data/lib/calculator_demo.rb
CHANGED
|
@@ -1,7 +1,28 @@
|
|
|
1
1
|
module CalculatorDemo
|
|
2
2
|
class Calci
|
|
3
|
-
|
|
3
|
+
##perform addition
|
|
4
|
+
def add(a,b)
|
|
4
5
|
return a+b
|
|
5
6
|
end
|
|
7
|
+
##perform substraction
|
|
8
|
+
def sub(a,b)
|
|
9
|
+
return a-b
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
##perform multiplication
|
|
13
|
+
def mul(a,b)
|
|
14
|
+
return a*b
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
##perform division
|
|
18
|
+
def div(a,b)
|
|
19
|
+
x = begin
|
|
20
|
+
a / b
|
|
21
|
+
rescue ZeroDivisionError
|
|
22
|
+
"You can't divide #{a} by #{b}"
|
|
23
|
+
end
|
|
24
|
+
return x
|
|
25
|
+
end
|
|
26
|
+
|
|
6
27
|
end
|
|
7
28
|
end
|
metadata
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: calculator_demo
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Hasmukh Rathod
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2018-01-
|
|
11
|
+
date: 2018-01-30 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
|
-
description:
|
|
13
|
+
description: Basic functions added.
|
|
14
14
|
email: hasmukh@thinkbiz.co.in
|
|
15
15
|
executables: []
|
|
16
16
|
extensions: []
|