basic_calculator 0.0.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 +7 -0
- data/lib/basic_calculator.rb +25 -0
- metadata +44 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA1:
|
|
3
|
+
metadata.gz: c78c4cf9a05c9c544099957d6c03aa9cd85c5a87
|
|
4
|
+
data.tar.gz: dedd5cfe432fcf99a132e07739032042eb31aa22
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 9fd2108077b375e040488a0864d079c4abb701c211eff99aeb8f86d45097edab6498a67cf673ed9a64fe5074620ec86fe9a2c4f007936e834274b899aa3bf4d3
|
|
7
|
+
data.tar.gz: e1259ce690bee07c4c25b441dd467b852c11280d80df5d71cc2c06621779e252ebb1fd37837b9fc7f08b71a34538a5f8cdb2546db89b6cba35224fe840244671
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
class BasicCalculator
|
|
2
|
+
def self.add(a,b)
|
|
3
|
+
begin
|
|
4
|
+
return a + b
|
|
5
|
+
rescue Exception => e
|
|
6
|
+
puts "Something went wrong #{e}"
|
|
7
|
+
end
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
def self.subtract(a,b)
|
|
11
|
+
begin
|
|
12
|
+
return a-b
|
|
13
|
+
rescue Exception => e
|
|
14
|
+
puts "Something went wrong #{e}"
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def self.multiply(a,b)
|
|
19
|
+
begin
|
|
20
|
+
return a*b
|
|
21
|
+
rescue Exception => e
|
|
22
|
+
"Something went wrong #{e}"
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
metadata
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: basic_calculator
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.0.1
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Syed Saud Hasan
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: bin
|
|
10
|
+
cert_chain: []
|
|
11
|
+
date: 2019-10-25 00:00:00.000000000 Z
|
|
12
|
+
dependencies: []
|
|
13
|
+
description: You can perform basic mathematical operations using this ruby gem
|
|
14
|
+
email: syedsaud@theporter.in
|
|
15
|
+
executables: []
|
|
16
|
+
extensions: []
|
|
17
|
+
extra_rdoc_files: []
|
|
18
|
+
files:
|
|
19
|
+
- lib/basic_calculator.rb
|
|
20
|
+
homepage: https://rubygems.org/gems/hola
|
|
21
|
+
licenses:
|
|
22
|
+
- PORTER
|
|
23
|
+
metadata: {}
|
|
24
|
+
post_install_message:
|
|
25
|
+
rdoc_options: []
|
|
26
|
+
require_paths:
|
|
27
|
+
- lib
|
|
28
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
29
|
+
requirements:
|
|
30
|
+
- - ">="
|
|
31
|
+
- !ruby/object:Gem::Version
|
|
32
|
+
version: '0'
|
|
33
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
34
|
+
requirements:
|
|
35
|
+
- - ">="
|
|
36
|
+
- !ruby/object:Gem::Version
|
|
37
|
+
version: '0'
|
|
38
|
+
requirements: []
|
|
39
|
+
rubyforge_project:
|
|
40
|
+
rubygems_version: 2.2.2
|
|
41
|
+
signing_key:
|
|
42
|
+
specification_version: 4
|
|
43
|
+
summary: Basic Calculator
|
|
44
|
+
test_files: []
|