queue_it 1.1.0 → 1.1.1

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
  SHA1:
3
- metadata.gz: 8150d61b7d0ab15e25a4f0fab5c03c467971e3d2
4
- data.tar.gz: 973591f75fa2065da623ffdde2ba528988d6c6c3
3
+ metadata.gz: 7a1f6124aaa5d9acd7c58b4e1843bbcd198a2792
4
+ data.tar.gz: 86cbadb417f9cedc44f9d4034dd512d9a42bc657
5
5
  SHA512:
6
- metadata.gz: 64388a8c6c1491f80164f130450363fe307145857cef71fb4980c5ea9e7b6d378364649d149ad0d3d24706fae84b9ef2732039c14ac66213e106758da9eefb8f
7
- data.tar.gz: caf23fffccda918e9f8c0f1dad37cd48b714c507d24afb43dc136d58830848bac51686a704820b888856b31d7e426197df28ce9114c20550d41ab6eca65a47d5
6
+ metadata.gz: b594d12cce86d4c31023f1193969d26cc6cc559101142e87cdc7c09e9fad0358061db805ef697b116bb1db3133c97dacd80afc932575c9dfe6e2f4f3fe58a018
7
+ data.tar.gz: 8d481d95d87154427f9e3880964bb2fc525e8a7c2c31f45211067f9a4ecd303b27f0df29598fe4de7f58a9868abae28151f453ad7c03bd15245dc737f8f16079
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ ### 1.1.1 - 2015-05-11
2
+
3
+ * `QueueIt::Api::Event`
4
+ * `#create_or_update` accepts `pre_queue_start_time`
5
+
1
6
  ### 1.1.0 - 2015-05-07
2
7
 
3
8
  * Basic Api 2.0.beta integration
@@ -11,10 +11,11 @@ module QueueIt
11
11
  self.client = client
12
12
  end
13
13
 
14
- def create_or_update(event_id:, display_name:, start_time:, know_user_secret_key: nil, redirect_url:, end_time: nil, description: "", event_culture_name: "en-US", time_zone: "UTC", queue_number_validity_in_minutes: 15)
14
+ def create_or_update(event_id:, display_name:, start_time:, pre_queue_start_time:nil, know_user_secret_key: nil, redirect_url:, end_time: nil, description: "", event_culture_name: "en-US", time_zone: "UTC", queue_number_validity_in_minutes: 15)
15
15
  raise InvalidEventIdFormat unless valid_event_id_format?(event_id)
16
16
 
17
17
  attributes = queue_attributes(
18
+ pre_queue_start_time: pre_queue_start_time,
18
19
  start_time: start_time,
19
20
  end_time: end_time,
20
21
  know_user_secret_key: know_user_secret_key,
@@ -69,8 +70,8 @@ module QueueIt
69
70
  end_time && end_time.utc || utc_start_time(start_time) + ONE_YEAR
70
71
  end
71
72
 
72
- def pre_queue_start_time(start_time)
73
- start_time.utc - ONE_HOUR
73
+ def utc_pre_queue_start_time(pre_queue_start_time, start_time)
74
+ pre_queue_start_time && pre_queue_start_time.utc || start_time.utc - ONE_HOUR
74
75
  end
75
76
 
76
77
  def format_time(time)
@@ -81,13 +82,13 @@ module QueueIt
81
82
  MICROSOFT_TIME_ZONE_INDEX_VALUES.fetch(time_zone, time_zone)
82
83
  end
83
84
 
84
- def queue_attributes(start_time:, end_time:, know_user_secret_key:, redirect_url:, description:, display_name:, event_culture_name:, queue_number_validity_in_minutes:, time_zone:)
85
+ def queue_attributes(pre_queue_start_time:, start_time:, end_time:, know_user_secret_key:, redirect_url:, description:, display_name:, event_culture_name:, queue_number_validity_in_minutes:, time_zone:)
85
86
  {
86
87
  "DisplayName" => display_name,
87
88
  "RedirectUrl" => URI(redirect_url).to_s,
88
89
  "Description" => description,
89
90
  "TimeZone" => translate_time_zone(time_zone),
90
- "PreQueueStartTime" => format_time( pre_queue_start_time(start_time) ),
91
+ "PreQueueStartTime" => format_time( utc_pre_queue_start_time(pre_queue_start_time, start_time) ),
91
92
  "EventStartTime" => format_time( utc_start_time(start_time) ),
92
93
  "EventEndTime" => format_time( utc_end_time(start_time, end_time) ),
93
94
  "EventCulture" => event_culture_name,
@@ -1,3 +1,3 @@
1
1
  module QueueIt
2
- VERSION = "1.1.0"
2
+ VERSION = "1.1.1"
3
3
  end
@@ -17,6 +17,9 @@ module QueueIt
17
17
  let(:redirect_url) { "https://example.com/en/events/fancy_event/tickets" }
18
18
  let(:time_zone) { "Europe/Copenhagen" }
19
19
  let(:event_culture_name) { "en-US" }
20
+ let(:pre_queue_start_time) { Time.new(2015,04,28,15,25,46, "+02:00") }
21
+ let(:start_time) { Time.new(2015,04,28,17,25,46, "+02:00") }
22
+ let(:end_time) { Time.new(2015,04,28,21,25,46, "+02:00") }
20
23
  let(:queue_number_validity_in_minutes) { 15 }
21
24
 
22
25
  specify "Submits proper request" do
@@ -26,8 +29,9 @@ module QueueIt
26
29
  display_name: display_name,
27
30
  description: description,
28
31
  redirect_url: redirect_url,
29
- start_time: Time.new(2015,04,28,17,25,46, "+02:00"),
30
- end_time: Time.new(2015,04,28,21,25,46, "+02:00"),
32
+ pre_queue_start_time: pre_queue_start_time,
33
+ start_time: start_time,
34
+ end_time: end_time,
31
35
  event_culture_name: event_culture_name,
32
36
  know_user_secret_key: know_user_secret_key,
33
37
  queue_number_validity_in_minutes: queue_number_validity_in_minutes)
@@ -39,6 +43,7 @@ module QueueIt
39
43
  "EventEndTime" => "2016-04-27T21:25:46.0000000Z",
40
44
  "EventCulture" => event_culture_name,
41
45
  "KnowUserSecretKey" => nil,
46
+ "PreQueueStartTime" => "2015-04-28T14:25:46.0000000Z",
42
47
  })
43
48
 
44
49
  expect(client).to receive(:put).with(event_id, body).and_return(double(body:{}))
@@ -60,8 +65,9 @@ module QueueIt
60
65
  display_name: display_name,
61
66
  description: description,
62
67
  redirect_url: redirect_url,
63
- start_time: Time.new(2015,04,28,17,25,46, "+02:00"),
64
- end_time: Time.new(2015,04,28,21,25,46, "+02:00"),
68
+ pre_queue_start_time: pre_queue_start_time,
69
+ start_time: start_time,
70
+ end_time: end_time,
65
71
  know_user_secret_key: know_user_secret_key,
66
72
  queue_number_validity_in_minutes: queue_number_validity_in_minutes,
67
73
  time_zone: time_zone,)
@@ -75,8 +81,9 @@ module QueueIt
75
81
  display_name: display_name,
76
82
  description: description,
77
83
  redirect_url: redirect_url,
78
- start_time: Time.new(2015,04,28,17,25,46, "+02:00"),
79
- end_time: Time.new(2015,04,28,21,25,46, "+02:00"),
84
+ pre_queue_start_time: pre_queue_start_time,
85
+ start_time: start_time,
86
+ end_time: end_time,
80
87
  know_user_secret_key: know_user_secret_key,
81
88
  queue_number_validity_in_minutes: queue_number_validity_in_minutes,
82
89
  time_zone: time_zone,)
@@ -91,8 +98,9 @@ module QueueIt
91
98
  display_name: display_name,
92
99
  description: description,
93
100
  redirect_url: redirect_url,
94
- start_time: Time.new(2015,04,28,17,25,46, "+02:00"),
95
- end_time: Time.new(2015,04,28,21,25,46, "+02:00"),
101
+ pre_queue_start_time: pre_queue_start_time,
102
+ start_time: start_time,
103
+ end_time: end_time,
96
104
  know_user_secret_key: know_user_secret_key,
97
105
  queue_number_validity_in_minutes: queue_number_validity_in_minutes,
98
106
  time_zone: time_zone,)
@@ -112,8 +120,9 @@ module QueueIt
112
120
  display_name: display_name,
113
121
  description: description,
114
122
  redirect_url: redirect_url,
115
- start_time: Time.new(2015,04,28,17,25,46, "+02:00"),
116
- end_time: Time.new(2015,04,28,21,25,46, "+02:00"),
123
+ pre_queue_start_time: pre_queue_start_time,
124
+ start_time: start_time,
125
+ end_time: end_time,
117
126
  event_culture_name: event_culture_name,
118
127
  know_user_secret_key: know_user_secret_key,
119
128
  queue_number_validity_in_minutes: queue_number_validity_in_minutes)
@@ -129,7 +138,7 @@ module QueueIt
129
138
  "RedirectUrl" => redirect_url,
130
139
  "Description" => description,
131
140
  "TimeZone" => "UTC",
132
- "PreQueueStartTime" => "2015-04-28T14:25:46.0000000Z",
141
+ "PreQueueStartTime" => "2015-04-28T13:25:46.0000000Z",
133
142
  "EventStartTime" => "2015-04-28T15:25:46.0000000Z",
134
143
  "EventEndTime" => "2015-04-28T19:25:46.0000000Z",
135
144
  "EventCulture" => event_culture_name,
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: queue_it
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Billetto
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-08 00:00:00.000000000 Z
11
+ date: 2015-05-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable