c80_shared 0.1.31 → 0.1.32

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 67ee8d9c2b4f04abc4ed5421e832edcdc9a03db966d6f43d70cea4305ced4ae6
4
- data.tar.gz: b773639ed62b3d0c23c5c3ba0117c5b58ac32e12a9e86dac749205bf968549d6
3
+ metadata.gz: 9cf5cdf52a85dac841173d40825dbf0453fe64d835df394bd73db735465e92cd
4
+ data.tar.gz: 0d54dcfd1388e3d4d927a0b2e705293a26ea4cb15551e116f43a7b5d55211308
5
5
  SHA512:
6
- metadata.gz: 1fdd80cf449a1ccbd7ba17e346032f28d392bdbdfa0bcdb919b49902963c9481d2a34c6f5f54f99bc4f1a35d44963b8152e3b80eddbee6c61273bfd5cc0f5e22
7
- data.tar.gz: 13b08b0e82d619f40aafac1ffd536ae183903ae0ce007218673301591a10c5eeaa17d2f042e27d5a5b39aac47baa2132e6c7c3711cb7a8a7318fe9043ced3086
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
@@ -0,0 +1,8 @@
1
+ module Dicts
2
+ class HullMaterial < ::Dict
3
+ ALUMINIUM = new 1, 'aluminium'
4
+ STEEL = new 2, 'steel'
5
+ FIBERGLASS = new 3, 'fiberglass'
6
+ WOOD = new 4, 'wood'
7
+ end
8
+ end
@@ -0,0 +1,6 @@
1
+ module Dicts
2
+ class Motor < ::Dict
3
+ POWERED = new 1, 'powered'
4
+ NON_POWERED = new 2, 'non_powered'
5
+ end
6
+ end
@@ -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
- { motor: boat.motor }
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
- { hull_material: boat.hull_material }
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)
@@ -0,0 +1,12 @@
1
+ en:
2
+ dicts:
3
+ exterior_color:
4
+ black: Black
5
+ white: White
6
+ silver: Silver
7
+ grey: Grey
8
+ beige: Beige
9
+ gold: Gold
10
+ metallic: Metallic
11
+ blue: Blue
12
+ :null: ''
@@ -0,0 +1,12 @@
1
+ ru:
2
+ dicts:
3
+ exterior_color:
4
+ black: Чёрный
5
+ white: Белый
6
+ silver: Серебристый
7
+ grey: Серый
8
+ beige: Бежевый
9
+ gold: Золотой
10
+ metallic: Металлик
11
+ blue: Голубой
12
+ :null: ''
@@ -0,0 +1,8 @@
1
+ en:
2
+ dicts:
3
+ hull_material:
4
+ aluminium: Aluminium
5
+ steel: Steel
6
+ fiberglass: Fiberglass
7
+ wood: Wood
8
+ :null: ''
@@ -0,0 +1,8 @@
1
+ ru:
2
+ dicts:
3
+ hull_material:
4
+ aluminium: Алюминий
5
+ steel: Сталь
6
+ fiberglass: Стекловолокно
7
+ wood: Дерево
8
+ :null: ''
@@ -0,0 +1,6 @@
1
+ en:
2
+ dicts:
3
+ motor:
4
+ powered: Powered
5
+ non_powered: Non-powered
6
+ :null: ''
@@ -0,0 +1,6 @@
1
+ ru:
2
+ dicts:
3
+ motor:
4
+ powered: Моторное судно
5
+ non_powered: Несамоходное судно
6
+ :null: ''
@@ -0,0 +1,6 @@
1
+ en:
2
+ dicts:
3
+ rental_type:
4
+ 'true': With Captain
5
+ 'false': No Captain
6
+ 'null': ''
@@ -0,0 +1,6 @@
1
+ ru:
2
+ dicts:
3
+ rental_type:
4
+ 'true': С капитаном
5
+ 'false': Без капитана
6
+ 'null': ''
@@ -1,3 +1,3 @@
1
1
  module C80Shared
2
- VERSION = "0.1.31"
2
+ VERSION = "0.1.32"
3
3
  end
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.31
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-05 00:00:00.000000000 Z
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