sipp 0.1.1 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/sipp/code.rb +49 -24
- data/lib/sipp/version.rb +1 -1
- data/lib/sipp.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: 2b070afc9f31b4d758cffb81730c1cf2f66c8f77
|
4
|
+
data.tar.gz: 0172f9196c6f4207143e8c18a8b2dfa5d159f761
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4f1dd007f766d6ec94dc27e07ee3f5115974a09547b4875bbe13f4625685234d378c34a9df427d25ac63e55895e64db9f0b880ed0a9631e8ea519b12c4ef5ee4
|
7
|
+
data.tar.gz: ad55e279ed148f69b247afe77300d7d75bfc216720677662a5676a0db9521e6b36eb9bdd75b735e3826a2d651faac05e929b8a2ac46b55eec9b2c370d4f9b6c1
|
data/lib/sipp/code.rb
CHANGED
@@ -26,61 +26,86 @@ module SIPP
|
|
26
26
|
end
|
27
27
|
|
28
28
|
def category
|
29
|
-
|
29
|
+
validate_category
|
30
|
+
CATEGORY[code[0]]
|
31
|
+
rescue CategoryError => e
|
32
|
+
nil
|
30
33
|
end
|
31
34
|
|
32
35
|
def type
|
33
|
-
|
36
|
+
validate_type
|
37
|
+
TYPE[code[1]]
|
38
|
+
rescue TypeError => e
|
39
|
+
nil
|
34
40
|
end
|
35
41
|
|
36
42
|
def transmission_drive
|
37
|
-
|
43
|
+
validate_transmission_drive
|
44
|
+
TRANSMISSION_DRIVE[code[2]]
|
45
|
+
rescue TransmissionDriveError => e
|
46
|
+
nil
|
38
47
|
end
|
39
48
|
|
40
49
|
def transmission
|
41
|
-
|
50
|
+
validate_transmission_drive
|
51
|
+
TRANSMISSION[code[2]]
|
52
|
+
rescue TransmissionDriveError => e
|
53
|
+
nil
|
42
54
|
end
|
43
55
|
|
44
56
|
def transmission_manual?
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
end
|
57
|
+
validate_transmission_drive
|
58
|
+
'Manual' == transmission ? true : false # TODO fix magic string
|
59
|
+
rescue TransmissionDriveError => e
|
60
|
+
nil
|
50
61
|
end
|
62
|
+
|
51
63
|
def transmission_auto?
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
end
|
64
|
+
validate_transmission_drive
|
65
|
+
'Auto' == transmission ? true : false # TODO fix magic string
|
66
|
+
rescue TransmissionDriveError => e
|
67
|
+
nil
|
57
68
|
end
|
69
|
+
|
58
70
|
def drive
|
59
|
-
|
71
|
+
validate_transmission_drive
|
72
|
+
DRIVE[code[2]]
|
73
|
+
rescue TransmissionDriveError => e
|
74
|
+
nil
|
60
75
|
end
|
61
76
|
|
62
77
|
def fuel_ac
|
63
|
-
|
78
|
+
validate_fuel_ac
|
79
|
+
FUEL_AC[code[3]]
|
80
|
+
rescue FuelACError => e
|
81
|
+
nil
|
64
82
|
end
|
65
83
|
|
66
84
|
def fuel
|
67
|
-
|
85
|
+
validate_fuel_ac
|
86
|
+
FUEL[code[3]]
|
87
|
+
rescue FuelACError => e
|
88
|
+
nil
|
68
89
|
end
|
69
90
|
|
70
91
|
def ac
|
71
|
-
|
92
|
+
validate_fuel_ac
|
93
|
+
AC[code[3]]
|
94
|
+
rescue FuelACError => e
|
95
|
+
nil
|
72
96
|
end
|
73
97
|
|
74
98
|
def ac?
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
end
|
99
|
+
validate_fuel_ac
|
100
|
+
'Air' == ac ? true : false # TODO fix magic string
|
101
|
+
rescue FuelACError => e
|
102
|
+
nil
|
80
103
|
end
|
81
104
|
|
82
105
|
def to_s
|
83
|
-
[category, type, transmission_drive, fuel_ac].join(' - ')
|
106
|
+
[category, type, transmission_drive, fuel_ac].map{|c| c.nil? ? '#N/A' : c}.join(' - ')
|
107
|
+
rescue CodeError, CategoryError, TypeError, TransmissionDriveError, FuelACError
|
108
|
+
''
|
84
109
|
end
|
85
110
|
|
86
111
|
private
|
data/lib/sipp/version.rb
CHANGED
data/lib/sipp.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sipp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Max Buslaev
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-08-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|