InfantDoseOfParacetamol 0.0.0

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.
Files changed (3) hide show
  1. checksums.yaml +7 -0
  2. data/lib/InfantDoseOfParacetamol.rb +38 -0
  3. metadata +46 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 4064c952c50f4c944288c99daa089a82c56b2113
4
+ data.tar.gz: 07f6cd3ded7787411215680ed1858e0e672ce9af
5
+ SHA512:
6
+ metadata.gz: 26e920afe36ce3c5c155bf3d499c9dff63324163d4f8853d658eac4e7cd6ce7929c12a0267a31e090c6099783a13d2a35c11a21ec48c3500eef56f4f5f006567
7
+ data.tar.gz: 68d40075fd5373f7b837d17efeec93e309257e749b8e59f4798571e6e55d49f973d3e612a8c697d33b986d0f4a9f8e7116140e261f83c2b69051b2141446a9ae
@@ -0,0 +1,38 @@
1
+ class InfantDoseOfParacetamol
2
+
3
+ def initialize(name , age , weight , strength)
4
+
5
+ @name = name
6
+ @age = age
7
+ @weight = weight
8
+ @strength = strength
9
+
10
+ end
11
+
12
+ def self.calculate(weight,strength)
13
+
14
+ @weight = weight
15
+ @strength = strength
16
+
17
+
18
+ @calculate = ((15 * @weight)*5) / @strength.to_f
19
+
20
+ if @calculate > 0
21
+
22
+ result = true
23
+
24
+ else
25
+
26
+ result = false
27
+ end
28
+
29
+ return result
30
+ end
31
+
32
+ def details
33
+ @calculate = ((15 * @weight)*5) / @strength.to_f
34
+
35
+ return "The Correct Dose of #{@name} of Age #{@age} having weight of #{@weight} is -->" + @calculate.to_s + "ml"
36
+
37
+ end
38
+ end
metadata ADDED
@@ -0,0 +1,46 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: InfantDoseOfParacetamol
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Bagchi Swarnadeep
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2016-12-02 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: |-
14
+ returns true if the dose is greater than 0.
15
+ otherwise returns false.
16
+ email: swarnainece@gmail.com
17
+ executables: []
18
+ extensions: []
19
+ extra_rdoc_files: []
20
+ files:
21
+ - lib/InfantDoseOfParacetamol.rb
22
+ homepage: http://rubygems.org/gems/InfantDoseOfParacetamol
23
+ licenses: []
24
+ metadata: {}
25
+ post_install_message:
26
+ rdoc_options: []
27
+ require_paths:
28
+ - lib
29
+ required_ruby_version: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ required_rubygems_version: !ruby/object:Gem::Requirement
35
+ requirements:
36
+ - - ">="
37
+ - !ruby/object:Gem::Version
38
+ version: '0'
39
+ requirements: []
40
+ rubyforge_project:
41
+ rubygems_version: 2.5.1
42
+ signing_key:
43
+ specification_version: 4
44
+ summary: Calculates dose of Paracetamol and Checks whether the dose is greater than
45
+ 0.
46
+ test_files: []