seatsio 37.0.0 → 39.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 642683cac1004690ea1b9ff67b597a707af152d97496331422c49522ad0143ef
4
- data.tar.gz: 9a27cedb746acd0c37f7b215bc6357de4a49a4c7dcec709cf21b079ecfa2951f
3
+ metadata.gz: b39228ed47149fc9a2838025ef2f526780b71eaf21392acb31bc0670f5e2ce19
4
+ data.tar.gz: 90878c4e718789672107f43b68160a87021886dfd0596d3a5ea2a1d2db0398ed
5
5
  SHA512:
6
- metadata.gz: 1e4702987535eb043a8d3fbfd43b32e29d7c7d75d9ed4253a74f0fbe2c1b0967ffbb568ca6126b83e68a9e82398a376e7cdd878b9f71c2c954ad3803fe472016
7
- data.tar.gz: 4ba09151dbe54589911cb8c22b9653978e382fa6f7cd8623a224a7a5de61b0ecff380d58ba777d045b88a9c2cf8cb7b9ad7f0e56fc7685ed78090646daba870e
6
+ metadata.gz: 4be94db2ebc61a6fc3b7cd2e16b60945ec3641b23da548fae3b5a777bc4387bd1df490d516c61b6b89c22f29a68a82accbf360e9b2db3482acc8ffdef618e5a6
7
+ data.tar.gz: 03c57f778377754a92b18bbf796486815fd5e4510150740c0b35c8954b69e81ba1fd2a76bd73ebfa15e485f8f31c0fe29a47c210c5c724271909add34f36dd09
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- seatsio (37.0.0)
4
+ seatsio (39.0.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -38,6 +38,14 @@ module Seatsio
38
38
  @http_client.post("charts/#{key}", payload)
39
39
  end
40
40
 
41
+ def add_category(key, category)
42
+ @http_client.post("charts/#{key}/categories", category)
43
+ end
44
+
45
+ def remove_category(key, category_key)
46
+ @http_client.delete("charts/#{key}/categories/#{category_key}")
47
+ end
48
+
41
49
  def add_tag(key, tag)
42
50
  @http_client.post("charts/#{key}/tags/#{CGI::escape(tag)}")
43
51
  end
@@ -70,6 +70,41 @@ module Seatsio
70
70
  end
71
71
  end
72
72
 
73
+ class Category
74
+
75
+ attr_reader :key, :label, :color, :accessible
76
+
77
+ def initialize(key, label, color, accessible)
78
+ @key = key
79
+ @label = label
80
+ @color = color
81
+ @accessible = accessible
82
+ end
83
+
84
+ def self.from_json(data)
85
+ if data
86
+ Category.new(data['key'], data['label'], data['color'], data['accessible'])
87
+ end
88
+ end
89
+
90
+ def self.create_list(list = [])
91
+ result = []
92
+
93
+ list.each do |item|
94
+ result << Category.from_json(item)
95
+ end
96
+
97
+ result
98
+ end
99
+
100
+ def == (other)
101
+ key == other.key &&
102
+ label == other.label &&
103
+ color == other.color &&
104
+ accessible == other.accessible
105
+ end
106
+ end
107
+
73
108
  class TableBookingConfig
74
109
 
75
110
  attr_reader :mode, :tables
@@ -114,11 +149,11 @@ module Seatsio
114
149
  end
115
150
 
116
151
  def == (other)
117
- self.key == other.key &&
118
- self.name == other.name &&
119
- self.color == other.color &&
120
- self.index == other.index &&
121
- self.objects == other.objects
152
+ key == other.key &&
153
+ name == other.name &&
154
+ color == other.color &&
155
+ index == other.index &&
156
+ objects == other.objects
122
157
  end
123
158
 
124
159
  end
@@ -149,7 +184,7 @@ module Seatsio
149
184
  @is_event_in_season = data['isEventInSeason']
150
185
  @top_level_season_key = data['topLevelSeasonKey']
151
186
  @object_categories = data['objectCategories']
152
- @categories = data['categories']
187
+ @categories = Category.create_list(data['categories']) if data['categories']
153
188
  end
154
189
 
155
190
  def is_season
@@ -441,16 +476,12 @@ module Seatsio
441
476
 
442
477
  class UsageByEvent
443
478
 
444
- attr_reader :event, :num_used_objects, :num_first_bookings, :num_first_bookings_or_selections,
445
- :num_ga_selections_without_booking, :num_non_ga_selections_without_booking, :num_object_selections
479
+ attr_reader :event, :num_used_objects, :num_first_bookings, :num_object_selections
446
480
 
447
481
  def initialize(data)
448
482
  @event = UsageEvent.new(data['event'])
449
483
  @num_used_objects = data['numUsedObjects']
450
484
  @num_first_bookings = data['numFirstBookings']
451
- @num_first_bookings_or_selections = data['numFirstBookingsOrSelections']
452
- @num_ga_selections_without_booking = data['numGASelectionsWithoutBooking']
453
- @num_non_ga_selections_without_booking = data['numNonGASelectionsWithoutBooking']
454
485
  @num_object_selections = data['numObjectSelections']
455
486
  end
456
487
  end
@@ -581,19 +612,19 @@ module Seatsio
581
612
  end
582
613
 
583
614
  def == (other)
584
- self.name == other.name &&
585
- self.number_of_disabled_seats_to_the_sides == other.number_of_disabled_seats_to_the_sides &&
586
- self.disable_seats_in_front_and_behind == other.disable_seats_in_front_and_behind &&
587
- self.disable_diagonal_seats_in_front_and_behind == other.disable_diagonal_seats_in_front_and_behind &&
588
- self.number_of_disabled_aisle_seats == other.number_of_disabled_aisle_seats &&
589
- self.max_group_size == other.max_group_size &&
590
- self.max_occupancy_absolute == other.max_occupancy_absolute &&
591
- self.max_occupancy_percentage == other.max_occupancy_percentage &&
592
- self.one_group_per_table == other.one_group_per_table &&
593
- self.fixed_group_layout == other.fixed_group_layout &&
594
- self.disabled_seats == other.disabled_seats &&
595
- self.enabled_seats == other.enabled_seats &&
596
- self.index == other.index
615
+ name == other.name &&
616
+ number_of_disabled_seats_to_the_sides == other.number_of_disabled_seats_to_the_sides &&
617
+ disable_seats_in_front_and_behind == other.disable_seats_in_front_and_behind &&
618
+ disable_diagonal_seats_in_front_and_behind == other.disable_diagonal_seats_in_front_and_behind &&
619
+ number_of_disabled_aisle_seats == other.number_of_disabled_aisle_seats &&
620
+ max_group_size == other.max_group_size &&
621
+ max_occupancy_absolute == other.max_occupancy_absolute &&
622
+ max_occupancy_percentage == other.max_occupancy_percentage &&
623
+ one_group_per_table == other.one_group_per_table &&
624
+ fixed_group_layout == other.fixed_group_layout &&
625
+ disabled_seats == other.disabled_seats &&
626
+ enabled_seats == other.enabled_seats &&
627
+ index == other.index
597
628
  end
598
629
  end
599
630
 
@@ -1,3 +1,3 @@
1
1
  module Seatsio
2
- VERSION = "37.0.0"
2
+ VERSION = "39.0.0"
3
3
  end
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: 37.0.0
4
+ version: 39.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: 2022-03-16 00:00:00.000000000 Z
11
+ date: 2022-06-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler