foo_mc 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.
- checksums.yaml +7 -0
- data/lib/foo/address.rb +61 -0
- data/lib/foo.rb +1 -0
- metadata +45 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA1:
|
|
3
|
+
metadata.gz: 288481497d7bd7763c326515e1662b0fa717df65
|
|
4
|
+
data.tar.gz: d60addfcf14c126a670e39d065b45cb3780cd3a6
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 1c5fb5ca529bfa8017eb3796617c6723866f9852ab45797faa87b0879650b91d8792a5b3d440c9dbbe70fa417f1b1312a488bcd376802c3bb5e353171c82879c
|
|
7
|
+
data.tar.gz: 90e6d0c3128286fd408ed92628d3e65dcad3978c60c932b3431d6e95c40d5c96048c6d383cb0692373d2c46a49d9b6195ad91fef0dd6c634f38a26cd3af21c8a
|
data/lib/foo/address.rb
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
module Foo
|
|
2
|
+
module Address
|
|
3
|
+
extend self
|
|
4
|
+
|
|
5
|
+
ADDRESSES = {
|
|
6
|
+
travelodge: {
|
|
7
|
+
uk_postcode: "E1 7EZ",
|
|
8
|
+
town: "London",
|
|
9
|
+
address_1: "20 Middlesex Street",
|
|
10
|
+
phone: "(871) 984 6534"
|
|
11
|
+
},
|
|
12
|
+
point_a: {
|
|
13
|
+
uk_postcode: "N1 6BX",
|
|
14
|
+
town: "London",
|
|
15
|
+
address_1: "13-15 Folgate Street",
|
|
16
|
+
address_2: "Spitalfields"
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
def uk_postcode(branch)
|
|
21
|
+
ADDRESSES[branch.to_sym][:uk_postcode] || ADDRESSES[branch.to_sym][:zipcode]
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
alias_method :zipcode, :uk_postcode
|
|
25
|
+
|
|
26
|
+
def town(branch)
|
|
27
|
+
ADDRESSES[branch.to_sym][:town]
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
def address_1(branch)
|
|
31
|
+
ADDRESSES[branch.to_sym][:address_1]
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
def address_2(branch)
|
|
35
|
+
ADDRESSES[branch.to_sym][:address_2]
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
def phone(branch)
|
|
39
|
+
ADDRESSES[branch.to_sym][:phone]
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
def full_address(branch)
|
|
43
|
+
address = "#{ address_1(branch) }#{ ', ' + address_2(branch) if address_2(branch) }, #{ town(branch) } #{ uk_postcode(branch) }"
|
|
44
|
+
if phone(branch)
|
|
45
|
+
address = "#{address}, #{phone(branch)}"
|
|
46
|
+
end
|
|
47
|
+
address
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
def full_address_as_array(branch)
|
|
51
|
+
[
|
|
52
|
+
address_1(branch),
|
|
53
|
+
address_2(branch),
|
|
54
|
+
town(branch),
|
|
55
|
+
uk_postcode(branch),
|
|
56
|
+
phone(branch)
|
|
57
|
+
].compact
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
|
data/lib/foo.rb
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require 'foo/address'
|
metadata
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: foo_mc
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.0.0
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Simply Business
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: bin
|
|
10
|
+
cert_chain: []
|
|
11
|
+
date: 2019-04-17 00:00:00.000000000 Z
|
|
12
|
+
dependencies: []
|
|
13
|
+
description:
|
|
14
|
+
email:
|
|
15
|
+
- mczapko@gmail.com
|
|
16
|
+
executables: []
|
|
17
|
+
extensions: []
|
|
18
|
+
extra_rdoc_files: []
|
|
19
|
+
files:
|
|
20
|
+
- lib/foo.rb
|
|
21
|
+
- lib/foo/address.rb
|
|
22
|
+
homepage:
|
|
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.6.14.1
|
|
42
|
+
signing_key:
|
|
43
|
+
specification_version: 4
|
|
44
|
+
summary: Just a foo
|
|
45
|
+
test_files: []
|