seatsio 27.0.0 → 28.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 +37 -16
- 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: 3d051975adb905e21e99a21b9eaba54b348f45f74ac9686364fe844804f7259b
|
4
|
+
data.tar.gz: ed83d35ccb688b8741257123daef0742bb822fe4e5a6a5cac299b6b5fad97787
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7ef44be79488dba3831bf5b2da54711963a8cf25c48dfd15ede94af7cd5d4a399740909e58db8f75242e55df1be9b111b685146ce006dbad156bb1c440e2ae0c
|
7
|
+
data.tar.gz: 9da2975e2cdd0fc319dcffc03766961941b87318a626fad76be129ce26f5c2c541a56f827433c962e8e7381743958685cf6e5fcbe44debf078e9134d4412be26
|
data/Gemfile.lock
CHANGED
data/lib/seatsio/domain.rb
CHANGED
@@ -22,10 +22,19 @@ module Seatsio
|
|
22
22
|
@archived = data['archived']
|
23
23
|
@validation = data['validation']
|
24
24
|
@social_distancing_rulesets = data['socialDistancingRulesets'].map {
|
25
|
-
|key, r| [key, SocialDistancingRuleset.new(r['name'],
|
26
|
-
|
27
|
-
|
28
|
-
|
25
|
+
|key, r| [key, SocialDistancingRuleset.new(r['name'],
|
26
|
+
number_of_disabled_seats_to_the_sides: r['numberOfDisabledSeatsToTheSides'],
|
27
|
+
disable_seats_in_front_and_behind: r['disableSeatsInFrontAndBehind'],
|
28
|
+
disable_diagonal_seats_in_front_and_behind: r['disableDiagonalSeatsInFrontAndBehind'],
|
29
|
+
number_of_disabled_aisle_seats: r['numberOfDisabledAisleSeats'],
|
30
|
+
max_group_size: r['maxGroupSize'],
|
31
|
+
max_occupancy_absolute: r['maxOccupancyAbsolute'],
|
32
|
+
max_occupancy_percentage: r['maxOccupancyPercentage'],
|
33
|
+
one_group_per_table: r['oneGroupPerTable'],
|
34
|
+
fixed_group_layout: r['fixedGroupLayout'],
|
35
|
+
disabled_seats: r['disabledSeats'],
|
36
|
+
enabled_seats: r['enabledSeats'],
|
37
|
+
index: r['index'])]
|
29
38
|
}.to_h
|
30
39
|
end
|
31
40
|
end
|
@@ -506,15 +515,16 @@ module Seatsio
|
|
506
515
|
|
507
516
|
class SocialDistancingRuleset
|
508
517
|
attr_reader :name, :number_of_disabled_seats_to_the_sides, :disable_seats_in_front_and_behind,
|
509
|
-
:number_of_disabled_aisle_seats, :max_group_size, :max_occupancy_absolute,
|
518
|
+
:disable_diagonal_seats_in_front_and_behind, :number_of_disabled_aisle_seats, :max_group_size, :max_occupancy_absolute,
|
510
519
|
:max_occupancy_percentage, :one_group_per_table, :fixed_group_layout, :disabled_seats, :enabled_seats, :index
|
511
520
|
|
512
|
-
def initialize(name, number_of_disabled_seats_to_the_sides
|
513
|
-
max_group_size
|
514
|
-
fixed_group_layout
|
521
|
+
def initialize(name, number_of_disabled_seats_to_the_sides: 0, disable_seats_in_front_and_behind: false, disable_diagonal_seats_in_front_and_behind: false,
|
522
|
+
number_of_disabled_aisle_seats: 0, max_group_size: 0, max_occupancy_absolute: 0, max_occupancy_percentage: 0, one_group_per_table: false,
|
523
|
+
fixed_group_layout: false, disabled_seats: [], enabled_seats: [], index: 0)
|
515
524
|
@name = name
|
516
525
|
@number_of_disabled_seats_to_the_sides = number_of_disabled_seats_to_the_sides
|
517
526
|
@disable_seats_in_front_and_behind = disable_seats_in_front_and_behind
|
527
|
+
@disable_diagonal_seats_in_front_and_behind = disable_diagonal_seats_in_front_and_behind
|
518
528
|
@number_of_disabled_aisle_seats = number_of_disabled_aisle_seats
|
519
529
|
@max_group_size = max_group_size
|
520
530
|
@max_occupancy_absolute = max_occupancy_absolute
|
@@ -526,22 +536,33 @@ module Seatsio
|
|
526
536
|
@index = index
|
527
537
|
end
|
528
538
|
|
529
|
-
def self.fixed(name, disabled_seats
|
530
|
-
SocialDistancingRuleset.new(name,
|
539
|
+
def self.fixed(name, disabled_seats: [], index: 0)
|
540
|
+
return SocialDistancingRuleset.new(name, index: index, disabled_seats: disabled_seats, fixed_group_layout: true)
|
531
541
|
end
|
532
542
|
|
533
|
-
def self.rule_based(name, number_of_disabled_seats_to_the_sides
|
534
|
-
max_group_size
|
535
|
-
disabled_seats
|
536
|
-
SocialDistancingRuleset.new(name,
|
537
|
-
|
538
|
-
|
543
|
+
def self.rule_based(name, number_of_disabled_seats_to_the_sides: 0, disable_seats_in_front_and_behind: false, disable_diagonal_seats_in_front_and_behind: false,
|
544
|
+
number_of_disabled_aisle_seats: 0, max_group_size: 0, max_occupancy_absolute: 0, max_occupancy_percentage: 0, one_group_per_table: false,
|
545
|
+
disabled_seats: [], enabled_seats: [], index: 0)
|
546
|
+
return SocialDistancingRuleset.new(name,
|
547
|
+
number_of_disabled_seats_to_the_sides: number_of_disabled_seats_to_the_sides,
|
548
|
+
disable_seats_in_front_and_behind: disable_seats_in_front_and_behind,
|
549
|
+
disable_diagonal_seats_in_front_and_behind: disable_diagonal_seats_in_front_and_behind,
|
550
|
+
number_of_disabled_aisle_seats: number_of_disabled_aisle_seats,
|
551
|
+
max_group_size: max_group_size,
|
552
|
+
max_occupancy_absolute: max_occupancy_absolute,
|
553
|
+
max_occupancy_percentage: max_occupancy_percentage,
|
554
|
+
one_group_per_table: one_group_per_table,
|
555
|
+
fixed_group_layout: false,
|
556
|
+
disabled_seats: disabled_seats,
|
557
|
+
enabled_seats: enabled_seats,
|
558
|
+
index: index)
|
539
559
|
end
|
540
560
|
|
541
561
|
def == (other)
|
542
562
|
self.name == other.name &&
|
543
563
|
self.number_of_disabled_seats_to_the_sides == other.number_of_disabled_seats_to_the_sides &&
|
544
564
|
self.disable_seats_in_front_and_behind == other.disable_seats_in_front_and_behind &&
|
565
|
+
self.disable_diagonal_seats_in_front_and_behind == other.disable_diagonal_seats_in_front_and_behind &&
|
545
566
|
self.number_of_disabled_aisle_seats == other.number_of_disabled_aisle_seats &&
|
546
567
|
self.max_group_size == other.max_group_size &&
|
547
568
|
self.max_occupancy_absolute == other.max_occupancy_absolute &&
|
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: 28.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-11-
|
11
|
+
date: 2020-11-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|