seatsio 25.3.0 → 26.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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/seatsio/domain.rb +23 -3
- data/lib/seatsio/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 56dacdba1281d3633ebd9eec2ef5ce9b3b35b1f6c5bd823be2e5f02bd8157962
|
4
|
+
data.tar.gz: b54123ab3b42336f2b490dbc669996be69e6cd3438c3591ed4722993cbd22c44
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 58833779b5be413655325bc3dce81ac8bd78382887d7c13caba7097e3a52f33dd6009e91abdce0bcbc7961b09a7518046b809c8348940d1dee1ab1ff0615b87a
|
7
|
+
data.tar.gz: 71ac86858ccb803b5eb5002ce59552c261daebae7ef509334b2bf38ac828f66bd10d77b95274f8a059bdf64c1c13d389c13bfc8407404cf607c3ecb7434b74d0
|
data/Gemfile.lock
CHANGED
data/lib/seatsio/domain.rb
CHANGED
@@ -24,6 +24,7 @@ module Seatsio::Domain
|
|
24
24
|
@social_distancing_rulesets = data['socialDistancingRulesets'].map {
|
25
25
|
|key, r| [key, SocialDistancingRuleset.new(r['name'], r['numberOfDisabledSeatsToTheSides'], r['disableSeatsInFrontAndBehind'],
|
26
26
|
r['numberOfDisabledAisleSeats'], r['maxGroupSize'],
|
27
|
+
r['maxOccupancyAbsolute'], r['maxOccupancyPercentage'], r['fixedGroupLayout'],
|
27
28
|
r['disabledSeats'], r['enabledSeats'], r['index'])]
|
28
29
|
}.to_h
|
29
30
|
end
|
@@ -474,31 +475,50 @@ module Seatsio::Domain
|
|
474
475
|
|
475
476
|
class SocialDistancingRuleset
|
476
477
|
attr_reader :name, :number_of_disabled_seats_to_the_sides, :disable_seats_in_front_and_behind,
|
477
|
-
:number_of_disabled_aisle_seats, :max_group_size, :
|
478
|
+
:number_of_disabled_aisle_seats, :max_group_size, :max_occupancy_absolute,
|
479
|
+
:max_occupancy_percentage, :fixed_group_layout, :disabled_seats, :enabled_seats, :index
|
478
480
|
|
479
481
|
def initialize(name, number_of_disabled_seats_to_the_sides = 0, disable_seats_in_front_and_behind = false, number_of_disabled_aisle_seats = 0,
|
480
|
-
max_group_size = 0,
|
482
|
+
max_group_size = 0, max_occupancy_absolute = 0, max_occupancy_percentage = 0, fixed_group_layout = false,
|
483
|
+
disabled_seats = [], enabled_seats = [], index = 0)
|
481
484
|
@name = name
|
482
485
|
@number_of_disabled_seats_to_the_sides = number_of_disabled_seats_to_the_sides
|
483
486
|
@disable_seats_in_front_and_behind = disable_seats_in_front_and_behind
|
484
487
|
@number_of_disabled_aisle_seats = number_of_disabled_aisle_seats
|
485
488
|
@max_group_size = max_group_size
|
489
|
+
@max_occupancy_absolute = max_occupancy_absolute
|
490
|
+
@max_occupancy_percentage = max_occupancy_percentage
|
491
|
+
@fixed_group_layout = fixed_group_layout
|
486
492
|
@disabled_seats = disabled_seats
|
487
493
|
@enabled_seats = enabled_seats
|
488
494
|
@index = index
|
489
495
|
end
|
490
496
|
|
497
|
+
def self.fixed(name, disabled_seats = [], index = 0)
|
498
|
+
SocialDistancingRuleset.new(name, 0, false, 0, 0, 0, 0, true, disabled_seats, [], index)
|
499
|
+
end
|
500
|
+
|
501
|
+
def self.rule_based(name, number_of_disabled_seats_to_the_sides = 0, disable_seats_in_front_and_behind = false, number_of_disabled_aisle_seats = 0,
|
502
|
+
max_group_size = 0, max_occupancy_absolute = 0, max_occupancy_percentage = 0,
|
503
|
+
disabled_seats = [], enabled_seats = [], index = 0)
|
504
|
+
SocialDistancingRuleset.new(name, number_of_disabled_seats_to_the_sides, disable_seats_in_front_and_behind, number_of_disabled_aisle_seats,
|
505
|
+
max_group_size, max_occupancy_absolute, max_occupancy_percentage,
|
506
|
+
false, disabled_seats, enabled_seats, index)
|
507
|
+
end
|
508
|
+
|
491
509
|
def == (other)
|
492
510
|
self.name == other.name &&
|
493
511
|
self.number_of_disabled_seats_to_the_sides == other.number_of_disabled_seats_to_the_sides &&
|
494
512
|
self.disable_seats_in_front_and_behind == other.disable_seats_in_front_and_behind &&
|
495
513
|
self.number_of_disabled_aisle_seats == other.number_of_disabled_aisle_seats &&
|
496
514
|
self.max_group_size == other.max_group_size &&
|
515
|
+
self.max_occupancy_absolute == other.max_occupancy_absolute &&
|
516
|
+
self.max_occupancy_percentage == other.max_occupancy_percentage &&
|
517
|
+
self.fixed_group_layout == other.fixed_group_layout &&
|
497
518
|
self.disabled_seats == other.disabled_seats &&
|
498
519
|
self.enabled_seats == other.enabled_seats &&
|
499
520
|
self.index == other.index
|
500
521
|
end
|
501
|
-
|
502
522
|
end
|
503
523
|
|
504
524
|
end
|
data/lib/seatsio/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: seatsio
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 26.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Seats.io
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-10-
|
11
|
+
date: 2020-10-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|