calcprice 1.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.
- checksums.yaml +7 -0
- data/lib/price.rb +31 -0
- metadata +43 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 429d0a5dd1ee7d006e978b2799c05fd9eb742b565bf7951244e9d6456db9dc14
|
|
4
|
+
data.tar.gz: 1049ce77ad4263ecae3e45b5175059760ebd96311fd30b08fe0fb0592521e47e
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: d5e453f7b937b003abf5a96c18ab26c32cdea25b171f8851c9e66070a093b8ea5a863f5e27e3190ddd2e2c4b0693255b3766de721375636812c92afd0ed0725e
|
|
7
|
+
data.tar.gz: f07bc24982edae81da04253f80cfd6a951d318f8161590aea692e8b8c36ff92265c9b968f741ab580d4a806819b6b0418b44b60a5fefd23e3944d346e73c50ff
|
data/lib/price.rb
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
require 'singleton'
|
|
2
|
+
|
|
3
|
+
class CalcPrice
|
|
4
|
+
include Singleton
|
|
5
|
+
|
|
6
|
+
def self.calc_price(lot, duration)
|
|
7
|
+
|
|
8
|
+
if lot == "basketball"
|
|
9
|
+
hourlyRate = 12
|
|
10
|
+
elsif lot == "football"
|
|
11
|
+
hourlyRate = 10
|
|
12
|
+
elsif lot == "squash"
|
|
13
|
+
hourlyRate = 9
|
|
14
|
+
elsif lot == "tennis"
|
|
15
|
+
hourlyRate = 7.5
|
|
16
|
+
elsif lot == "golf"
|
|
17
|
+
hourlyRate = 10
|
|
18
|
+
elsif lot == "gym"
|
|
19
|
+
hourlyRate = 6.5
|
|
20
|
+
elsif lot == "swimming pool"
|
|
21
|
+
hourlyRate = 5
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
finalPrice = duration*hourlyRate
|
|
25
|
+
|
|
26
|
+
return finalPrice
|
|
27
|
+
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
end
|
|
31
|
+
|
metadata
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: calcprice
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 1.0.0
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Rostifur23
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: bin
|
|
10
|
+
cert_chain: []
|
|
11
|
+
date: 2019-03-29 00:00:00.000000000 Z
|
|
12
|
+
dependencies: []
|
|
13
|
+
description: A simple gem
|
|
14
|
+
email: ross.delaney23@gmail.com
|
|
15
|
+
executables: []
|
|
16
|
+
extensions: []
|
|
17
|
+
extra_rdoc_files: []
|
|
18
|
+
files:
|
|
19
|
+
- lib/price.rb
|
|
20
|
+
homepage: http://rubygems.org/gems/calcprice
|
|
21
|
+
licenses: []
|
|
22
|
+
metadata: {}
|
|
23
|
+
post_install_message:
|
|
24
|
+
rdoc_options: []
|
|
25
|
+
require_paths:
|
|
26
|
+
- lib
|
|
27
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
28
|
+
requirements:
|
|
29
|
+
- - ">="
|
|
30
|
+
- !ruby/object:Gem::Version
|
|
31
|
+
version: '0'
|
|
32
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
33
|
+
requirements:
|
|
34
|
+
- - ">="
|
|
35
|
+
- !ruby/object:Gem::Version
|
|
36
|
+
version: '0'
|
|
37
|
+
requirements: []
|
|
38
|
+
rubyforge_project:
|
|
39
|
+
rubygems_version: 2.7.6
|
|
40
|
+
signing_key:
|
|
41
|
+
specification_version: 4
|
|
42
|
+
summary: Calculates the price of a booking in a sports facility
|
|
43
|
+
test_files: []
|