bill_hicks 1.1.9.pre2 → 1.1.9.pre3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/bill_hicks/brand_converter.rb +8 -4
- data/lib/bill_hicks/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 24ae9a58bac5093ef7394be92c855a7f6c6500f6
|
4
|
+
data.tar.gz: 9e815c6bf17d31feaa615a32d77907f78fc97d9f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c3d3f6efb9b0a66109cd8bffc5bfb379fcfebc89b8d4d76d2b1510bec34719598e874ffdc9bc236d2bc746b8426db33de8e7dc8af087fb846f07d3a244dc230c
|
7
|
+
data.tar.gz: bf49e2eebdbfab42f67ff06fe1da3470271834f0d742eead1384d85249524f2f5c0bb7893d7b570a00c4cbead5bf476b7a1d1117dcffc22a62ed5d5766180c3c
|
@@ -1,14 +1,18 @@
|
|
1
1
|
module BillHicks
|
2
2
|
class BrandConverter
|
3
|
+
|
4
|
+
@@brands = nil
|
5
|
+
|
3
6
|
def self.convert(value)
|
4
|
-
if brand =
|
7
|
+
if brand = self.brands.detect {|brand| brand[:prefix] == value.split[0] }
|
5
8
|
brand[:company].empty? ? value.split[0] : brand[:company]
|
6
9
|
else
|
7
10
|
value.split[0]
|
8
11
|
end
|
9
12
|
end
|
10
13
|
|
11
|
-
|
14
|
+
def self.brands
|
15
|
+
@@brands ||= [
|
12
16
|
{"prefix":"2A","company":"2A ARMAMENT"},
|
13
17
|
{"prefix":"AAE","company":"AA&E"},
|
14
18
|
{"prefix":"ADAMS","company":"ADAMS ARMS"},
|
@@ -392,8 +396,8 @@ module BillHicks
|
|
392
396
|
{"prefix":"XP","company":"X PRODUCTS LLC"},
|
393
397
|
{"prefix":"YHM","company":"YANKEE HILL MACHINE CO., INC."},
|
394
398
|
{"prefix":"ZS","company":"CARL ZEISS SBE, LLC."},
|
395
|
-
{"prefix":"ZEN","company":"ZENITH FIREARMS"}
|
396
|
-
|
399
|
+
{"prefix":"ZEN","company":"ZENITH FIREARMS"}]
|
400
|
+
end
|
397
401
|
|
398
402
|
end
|
399
403
|
end
|
data/lib/bill_hicks/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bill_hicks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.9.
|
4
|
+
version: 1.1.9.pre3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dale Campbell
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-04-
|
11
|
+
date: 2017-04-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: smarter_csv
|