c80_shared 0.1.31 → 0.1.32
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 +4 -4
- data/app/dicts/exterior_color.rb +12 -0
- data/app/dicts/hull_material.rb +8 -0
- data/app/dicts/motor.rb +6 -0
- data/app/serializers/boat_serializer.rb +36 -2
- data/config/locales/dicts/exterior_color/en.yml +12 -0
- data/config/locales/dicts/exterior_color/ru.yml +12 -0
- data/config/locales/dicts/hull_material/en.yml +8 -0
- data/config/locales/dicts/hull_material/ru.yml +8 -0
- data/config/locales/dicts/motor/en.yml +6 -0
- data/config/locales/dicts/motor/ru.yml +6 -0
- data/config/locales/dicts/rental_type/en.yml +6 -0
- data/config/locales/dicts/rental_type/ru.yml +6 -0
- data/lib/c80_shared/version.rb +1 -1
- metadata +13 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9cf5cdf52a85dac841173d40825dbf0453fe64d835df394bd73db735465e92cd
|
4
|
+
data.tar.gz: 0d54dcfd1388e3d4d927a0b2e705293a26ea4cb15551e116f43a7b5d55211308
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: db857ac175901f7e40d88fa36455efcca793590bacd267d8b401124014530a5fb596bce1621e6f2510b5ac4c083b594c1bfdf0857a0330b3093899cb18167f45
|
7
|
+
data.tar.gz: 05d288a0917c37bba85bea9a424538576a50a93ead77caec78a7114f5351130125045f744ebc033957b2743cffb2800bda639317119ae71c73789fc41d809f6f
|
@@ -0,0 +1,12 @@
|
|
1
|
+
module Dicts
|
2
|
+
class ExteriorColor < ::Dict
|
3
|
+
BLACK = new 1, 'black'
|
4
|
+
WHITE = new 2, 'white'
|
5
|
+
SILVER = new 3, 'silver'
|
6
|
+
GREY = new 4, 'grey'
|
7
|
+
BEIGE = new 5, 'beige'
|
8
|
+
GOLD = new 6, 'gold'
|
9
|
+
METALLIC = new 7, 'metallic'
|
10
|
+
BLUE = new 8, 'blue'
|
11
|
+
end
|
12
|
+
end
|
data/app/dicts/motor.rb
ADDED
@@ -24,6 +24,7 @@ class BoatSerializer < AbstractSerializer
|
|
24
24
|
builder
|
25
25
|
built_year
|
26
26
|
crew_total
|
27
|
+
exterior_color
|
27
28
|
guest_cabins
|
28
29
|
guests_total
|
29
30
|
hull_material
|
@@ -39,6 +40,7 @@ class BoatSerializer < AbstractSerializer
|
|
39
40
|
picture_medium_url
|
40
41
|
prices
|
41
42
|
refit_year
|
43
|
+
rental_type
|
42
44
|
short_description
|
43
45
|
state
|
44
46
|
visits_today
|
@@ -90,7 +92,13 @@ class BoatSerializer < AbstractSerializer
|
|
90
92
|
end
|
91
93
|
|
92
94
|
def motor(boat)
|
93
|
-
|
95
|
+
m = ::Dicts::Motor.find boat.motor
|
96
|
+
{
|
97
|
+
motor: {
|
98
|
+
id: (m.id rescue -1),
|
99
|
+
index: (m.index rescue 'null')
|
100
|
+
}
|
101
|
+
}
|
94
102
|
end
|
95
103
|
|
96
104
|
def main_boat_photo_id(boat)
|
@@ -111,6 +119,16 @@ class BoatSerializer < AbstractSerializer
|
|
111
119
|
{ short_description: value }
|
112
120
|
end
|
113
121
|
|
122
|
+
def exterior_color(boat)
|
123
|
+
color = ::Dicts::ExteriorColor.find boat.exterior_color
|
124
|
+
{
|
125
|
+
exterior_color: {
|
126
|
+
id: (color.id rescue -1),
|
127
|
+
index: (color.index rescue 'null')
|
128
|
+
}
|
129
|
+
}
|
130
|
+
end
|
131
|
+
|
114
132
|
# per day, per week; в день, в час, за месяц;
|
115
133
|
# def per_season(boat)
|
116
134
|
# season_key = ::Lib::Boats::RentPricePerSeason.spot_rentprice_id(boat, @opts[:currency], @opts[:rent_price_id]).gsub(/_low|_high/, '')
|
@@ -151,7 +169,23 @@ class BoatSerializer < AbstractSerializer
|
|
151
169
|
end
|
152
170
|
|
153
171
|
def hull_material(boat)
|
154
|
-
|
172
|
+
hm = ::Dicts::HullMaterial.find boat.hull_material
|
173
|
+
{
|
174
|
+
hull_material: {
|
175
|
+
id: (hm.id rescue -1),
|
176
|
+
index: (hm.index rescue 'null')
|
177
|
+
}
|
178
|
+
}
|
179
|
+
end
|
180
|
+
|
181
|
+
def rental_type(boat)
|
182
|
+
hm = ::Dicts::RentSkipType.find boat.rental_type
|
183
|
+
{
|
184
|
+
rental_type: {
|
185
|
+
id: (hm.id rescue -1),
|
186
|
+
index: (hm.index rescue 'null')
|
187
|
+
}
|
188
|
+
}
|
155
189
|
end
|
156
190
|
|
157
191
|
def crew_total(boat)
|
data/lib/c80_shared/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: c80_shared
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.32
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- C80609A
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-03-
|
11
|
+
date: 2019-03-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -55,8 +55,11 @@ files:
|
|
55
55
|
- app/dicts/charter_uom.rb
|
56
56
|
- app/dicts/currency.rb
|
57
57
|
- app/dicts/email_token_subj.rb
|
58
|
+
- app/dicts/exterior_color.rb
|
59
|
+
- app/dicts/hull_material.rb
|
58
60
|
- app/dicts/length.rb
|
59
61
|
- app/dicts/locale.rb
|
62
|
+
- app/dicts/motor.rb
|
60
63
|
- app/dicts/rent_skip_type.rb
|
61
64
|
- app/helpers/custom/currency_helper.rb
|
62
65
|
- app/helpers/custom/dimension_helper.rb
|
@@ -85,8 +88,16 @@ files:
|
|
85
88
|
- c80_shared.gemspec
|
86
89
|
- config/locales/boat/en.yml
|
87
90
|
- config/locales/boat/ru.yml
|
91
|
+
- config/locales/dicts/exterior_color/en.yml
|
92
|
+
- config/locales/dicts/exterior_color/ru.yml
|
93
|
+
- config/locales/dicts/hull_material/en.yml
|
94
|
+
- config/locales/dicts/hull_material/ru.yml
|
88
95
|
- config/locales/dicts/length/en.yml
|
89
96
|
- config/locales/dicts/length/ru.yml
|
97
|
+
- config/locales/dicts/motor/en.yml
|
98
|
+
- config/locales/dicts/motor/ru.yml
|
99
|
+
- config/locales/dicts/rental_type/en.yml
|
100
|
+
- config/locales/dicts/rental_type/ru.yml
|
90
101
|
- config/locales/rent_skip_type/en.yml
|
91
102
|
- config/locales/rent_skip_type/ru.yml
|
92
103
|
- lib/c80_shared.rb
|