pubnub 4.0.14 → 4.0.15

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of pubnub might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 20a17fcca83f683fa37ed4f336f5c4294fda9c22
4
- data.tar.gz: 9728fff99ed82ce3d4e5fadd2d1cea9c8684b11e
3
+ metadata.gz: bffc021ca7201981746956abf292ae8f12963964
4
+ data.tar.gz: 3aec5abe0bd03c8e8b2b834a81e03f8f9d82dee6
5
5
  SHA512:
6
- metadata.gz: 276b78f63c539defe5b321ad6e34d487f2319dc12e721a358749a9a848b1c0cbd09c149dad22acd349212d058dfe522f758aeb721442e89d1b7b6b5e1a8781e9
7
- data.tar.gz: c7065361f9312f1fd3c1f323a5ee5fafe1733f249ae098e214d70b077cd0c080b018bd28da3f71828229574cba196454392bcfcefc3a043b6cf1030cf4144ed3
6
+ metadata.gz: 862f1901f0da2c48f84d70c91d0544110df725fb56ab3914088593cd65f384fdabcc6284de6eab6952ede34ae9a09a4052383a3a2f27c844d04854de2cb16704
7
+ data.tar.gz: 7bc373fec98a0dec74d5b84cb50a737df7748b5097aae6e533d9cd23ac017246a012048aeea4a53e3a1eb28a63123613bff67330fa31b82520f5853c1c60003c
data/.pubnub.yml CHANGED
@@ -1,5 +1,12 @@
1
1
  ---
2
2
  changelog:
3
+ -
4
+ changes:
5
+ -
6
+ text: "Fixed PAM signature when some special characters are present"
7
+ type: bugfix
8
+ date: ~
9
+ version: v4.0.15
3
10
  -
4
11
  changes:
5
12
  -
@@ -172,4 +179,4 @@ features:
172
179
  name: ruby
173
180
  schema: 1
174
181
  scm: github.com/pubnub/ruby
175
- version: "4.0.14"
182
+ version: "4.0.15"
data/CHANGELOG.md CHANGED
@@ -1,8 +1,9 @@
1
- ##### 4.0.14
2
- * Added ttl parameter for publish
1
+ ##### 4.0.15
2
+ * Fixed PAM signature when some special characters are present
3
3
 
4
4
  ##### 4.0.13
5
5
  * Changed init message log level to debug
6
+ * Added ttl parameter for publish
6
7
 
7
8
  ##### 4.0.12
8
9
  * Added alert on catchup failure (REQUEST_MESSAGE_COUNT_EXCEEDED)
data/Gemfile.lock CHANGED
@@ -38,6 +38,7 @@ GEM
38
38
  url
39
39
  coderay (1.1.0)
40
40
  concurrent-ruby (1.0.2)
41
+ concurrent-ruby (1.0.2-java)
41
42
  crack (0.4.2)
42
43
  safe_yaml (~> 1.0.0)
43
44
  diff-lcs (1.2.5)
@@ -72,6 +73,7 @@ GEM
72
73
  dry-types (~> 0.9, >= 0.9.0)
73
74
  ffi (1.9.10-java)
74
75
  hitimes (1.2.4)
76
+ hitimes (1.2.4-java)
75
77
  httpclient (2.8.2.4)
76
78
  inflecto (0.0.2)
77
79
  json (2.0.2)
@@ -0,0 +1,1304 @@
1
+ # Pubnub Ruby SDK upgrade guide
2
+ This guide covers upgrading pubnub SDK from 3.8 to 4.x version.
3
+
4
+ ## Subscribe changes
5
+ Here are big changes. Subscribe doesn't accept callback parameter anymore, right now you need to create Listener instance and attach it to pubnub client object.
6
+
7
+ Listener has to contain three callbacks, for status messages (like connect, disconnect), for messages on channel (messages published on subscribed channels) and for presence events (like join, leave).
8
+
9
+ Example of listener:
10
+ ```ruby=
11
+ listener = Pubnub::SubscribeCallback.new(
12
+ # Callback for messages published on subscribed channels
13
+ message: lambda do |envelope|
14
+ puts "MESSAGE: #{envelope.result[:data]}"
15
+ end,
16
+ # Callback for presence events from subscribed channels
17
+ presence: lambda do |envelope|
18
+ puts "PRESENCE: #{envelope.result[:data]}"
19
+ end,
20
+ # Status callbacks
21
+ status: lambda do |envelope|
22
+ puts "\n\n\n#{envelope.status}\n\n\n"
23
+
24
+ if envelope.error?
25
+ # Something bad happend
26
+ puts "ERROR! #{envelope.status[:category]}"
27
+ else
28
+ # Connected!
29
+ puts 'Connected!' if envelope.status[:last_timetoken] == 0
30
+ end
31
+ end
32
+ )
33
+ ```
34
+
35
+ Attaching it to client:
36
+ ```ruby
37
+ pubnub.add_listener(callback: listener)
38
+ ```
39
+
40
+ Simple example of upgraded code:
41
+ ```ruby=
42
+ # Old one
43
+ pubnub.subscribe(channel: :demo){ |envelope| puts envelope.message }
44
+
45
+ # New one
46
+ listener = Pubnub::SubscribeCallback.new(
47
+ message: ->(envelope){ puts envelope.result[:data] },
48
+ status: ->(_e){},
49
+ presence: ->(_e){}
50
+ )
51
+
52
+ pubnub.add_listener(callback: listener)
53
+
54
+ pubnub.subscribe(channel: :demo)
55
+ ```
56
+
57
+ ## Presence changes
58
+ Take a look at subscribe changes. Presence works exactly te same way, presence messages are passed to `:presence` callback from listeners.
59
+
60
+ ## Method changes
61
+ ### Removed methods
62
+ Following client methods was removed:
63
+ * `#set_auth_key`
64
+ * `#auth_key=`
65
+ * `#set_uuid`
66
+ * `#uuid=`
67
+
68
+ Both `auth_key` and `uuid` can't be changed after client is initialized.
69
+
70
+ ### Added methods
71
+ Following client methods were added:
72
+ * `#subscribed_to` - returns subscribed channels list
73
+ * `#current_region` - returns current region code
74
+ * `#region=` - allows to set region
75
+ * `#current_heartbeat` - returns current heartbeat interval value
76
+ * `#subscribe_filter=` - allows to specify [subscribe filter expression](https://www.pubnub.com/docs/ruby/stream-filtering-tutorial-sdk-v4#subscribing-with-filtering)
77
+
78
+ ### Removed parametes
79
+ #### Client init
80
+ * `:connect_callback` - now it's handled by status envelope passed to listeners.
81
+
82
+ ### Added parameters
83
+ #### Subscribe
84
+ * `:with_presence` - can be set as true or false. When sets to true client subscribes to presence channels of given channels as well.
85
+
86
+ #### Publish
87
+ * `:replicate` - if message should be replicated to other regions
88
+ * `:meta` - meta values used by message filtering
89
+ * `:ttl` - accepts integer value. Specifies how long published message should be stored in history
90
+
91
+ #### History
92
+ * `:include_token` - if set to true, messages will be returned with their time tokens
93
+
94
+ ## Changes worth mention
95
+ ### REQUEST_MESSGE_COUNT_EXCEEDED
96
+ When there's **really** high traffic on channel there's chance that subscribe will hit retrieval limit (100 messages at once). The REQUEST_MESSGE_COUNT_EXCEEDED status envelope will be passed to all listeners when subscribe hit limit. You can then run `history` call to retrieve that messages.
97
+
98
+ ### Super Admin Mode
99
+ When secret_key is provided Pubnub Client is in super admin mode. PAM restrictions don't affect this client.
100
+
101
+ # Envelopes
102
+ Envelopes has changed a lot compared to 3.8 version. Below you can find all envelopes with examples
103
+
104
+ ## Subscribe/Presence
105
+ Most important part: `result[:data]`
106
+
107
+ ```ruby
108
+ #<Pubnub::Envelope:0x007fb4c8151998
109
+ @event=:subscribe,
110
+ @event_options={:ssl=>false},
111
+ @id="01471808-d2f1-4c5e-85f9-56226969e6de",
112
+ @result=
113
+ {:code=>200,
114
+ :operation=>:subscribe,
115
+ :client_request=>
116
+ #<URI::HTTP http://pubsub.pubnub.com/v2/subscribe/demo/whatever/0?pnsdk=PubNub-Ruby%2F4.0.13&t=%7B%22r%22%3A12%2C%22t%22%3A%2214793085739462384%22%7D&uuid=37c5370b-6fca-4fcc-a7d1-f82f18596e88>,
117
+ :server_response=>
118
+ #<HTTP::Message:0x0056126377b368
119
+ @http_body=
120
+ #<HTTP::Message::Body:0x0056126377b048
121
+ @body=
122
+ "{\"t\":{\"t\":\"14793085968022384\",\"r\":12},\"m\":[{\"a\":\"1\",\"f\":514,\"i\":\"2b3abf1f-a479-4f41-bb22-c5719f9ad6f9\",\"p\":{\"t\":\"14793085968029284\",\"r\":12},\"k\":\"demo\",\"c\":\"whatever\",\"d\":{\"text\":\"hey\"}}]}",
123
+ @chunk_size=nil,
124
+ @positions=nil,
125
+ @size=0>,
126
+ @http_header=
127
+ #<HTTP::Message::Headers:0x0056126377b2f0
128
+ @body_charset=nil,
129
+ @body_date=nil,
130
+ @body_encoding=#<Encoding:UTF-8>,
131
+ @body_size=0,
132
+ @body_type=nil,
133
+ @chunked=false,
134
+ @dumped=false,
135
+ @header_item=
136
+ [["Date", "Wed, 16 Nov 2016 15:03:16 GMT"],
137
+ ["Content-Type", "text/javascript; charset=\"UTF-8\""],
138
+ ["Content-Length", "187"],
139
+ ["Connection", "keep-alive"],
140
+ ["Cache-Control", "no-cache"],
141
+ ["Access-Control-Allow-Origin", "*"],
142
+ ["Access-Control-Allow-Methods", "GET"]],
143
+ @http_version="1.1",
144
+ @is_request=false,
145
+ @reason_phrase="OK",
146
+ @request_absolute_uri=nil,
147
+ @request_method="GET",
148
+ @request_query=nil,
149
+ @request_uri=
150
+ #<Addressable::URI:0x2b0931bbdf54 URI:http://pubsub.pubnub.com/v2/subscribe/demo/whatever/0?pnsdk=PubNub-Ruby%2F4.0.13&t=%7B%22r%22%3A12%2C%22t%22%3A%2214793085739462384%22%7D&uuid=37c5370b-6fca-4fcc-a7d1-f82f18596e88>,
151
+ @status_code=200>,
152
+ @peer_cert=nil,
153
+ @previous=nil>,
154
+ :data=>
155
+ {:message=>{"text"=>"hey"},
156
+ :subscribed_channel=>"whatever",
157
+ :actual_channel=>"whatever",
158
+ :publish_time_object=>{:timetoken=>"14793085968029284", :region_code=>12},
159
+ :message_meta_data=>nil,
160
+ :presence_event=>nil,
161
+ :presence=>nil}},
162
+ @status=
163
+ {:code=>200,
164
+ :client_request=>
165
+ #<URI::HTTP http://pubsub.pubnub.com/v2/subscribe/demo/whatever/0?pnsdk=PubNub-Ruby%2F4.0.13&t=%7B%22r%22%3A12%2C%22t%22%3A%2214793085739462384%22%7D&uuid=37c5370b-6fca-4fcc-a7d1-f82f18596e88>,
166
+ :server_response=>
167
+ #<HTTP::Message:0x0056126377b368
168
+ @http_body=
169
+ #<HTTP::Message::Body:0x0056126377b048
170
+ @body=
171
+ "{\"t\":{\"t\":\"14793085968022384\",\"r\":12},\"m\":[{\"a\":\"1\",\"f\":514,\"i\":\"2b3abf1f-a479-4f41-bb22-c5719f9ad6f9\",\"p\":{\"t\":\"14793085968029284\",\"r\":12},\"k\":\"demo\",\"c\":\"whatever\",\"d\":{\"text\":\"hey\"}}]}",
172
+ @chunk_size=nil,
173
+ @positions=nil,
174
+ @size=0>,
175
+ @http_header=
176
+ #<HTTP::Message::Headers:0x0056126377b2f0
177
+ @body_charset=nil,
178
+ @body_date=nil,
179
+ @body_encoding=#<Encoding:UTF-8>,
180
+ @body_size=0,
181
+ @body_type=nil,
182
+ @chunked=false,
183
+ @dumped=false,
184
+ @header_item=
185
+ [["Date", "Wed, 16 Nov 2016 15:03:16 GMT"],
186
+ ["Content-Type", "text/javascript; charset=\"UTF-8\""],
187
+ ["Content-Length", "187"],
188
+ ["Connection", "keep-alive"],
189
+ ["Cache-Control", "no-cache"],
190
+ ["Access-Control-Allow-Origin", "*"],
191
+ ["Access-Control-Allow-Methods", "GET"]],
192
+ @http_version="1.1",
193
+ @is_request=false,
194
+ @reason_phrase="OK",
195
+ @request_absolute_uri=nil,
196
+ @request_method="GET",
197
+ @request_query=nil,
198
+ @request_uri=
199
+ #<Addressable::URI:0x2b0931bbdf54 URI:http://pubsub.pubnub.com/v2/subscribe/demo/whatever/0?pnsdk=PubNub-Ruby%2F4.0.13&t=%7B%22r%22%3A12%2C%22t%22%3A%2214793085739462384%22%7D&uuid=37c5370b-6fca-4fcc-a7d1-f82f18596e88>,
200
+ @status_code=200>,
201
+ @peer_cert=nil,
202
+ @previous=nil>,
203
+ :data=>
204
+ {:shard=>"1",
205
+ :channel=>"whatever",
206
+ :subscription_match=>nil,
207
+ :payload=>{"text"=>"hey"},
208
+ :flags=>514,
209
+ :issuing_client_id=>"2b3abf1f-a479-4f41-bb22-c5719f9ad6f9",
210
+ :subscribe_key=>"demo",
211
+ :sequence_number=>nil,
212
+ :user_meta_data=>nil,
213
+ :replication_map=>nil,
214
+ :eat_after_reading=>nil,
215
+ :waypoint_list=>nil,
216
+ :origination_time_token=>nil,
217
+ :publish_timetoken=>{:timetoken=>"14793085968029284", :region_code=>12}},
218
+ :category=>:ack,
219
+ :error=>false,
220
+ :auto_retried=>true,
221
+ :current_timetoken=>14793085968022384,
222
+ :last_timetoken=>14793085739462384,
223
+ :subscribed_channels=>["whatever"],
224
+ :subscribed_channel_groups=>[],
225
+ :config=>
226
+ {:tls=>false,
227
+ :uuid=>"37c5370b-6fca-4fcc-a7d1-f82f18596e88",
228
+ :auth_key=>nil,
229
+ :origin=>"pubsub.pubnub.com"}},
230
+ @timetoken={:timetoken=>"14793085968022384", :region_code=>12}>
231
+ ```
232
+
233
+ ## Audit
234
+ Most important part: `result[:data]`
235
+
236
+ ```ruby
237
+ #<Pubnub::Envelope:0x007fc3240706b8
238
+ @event=:audit,
239
+ @event_options={:channel=>:whatever, :http_sync=>true, :callback=>nil},
240
+ @id="e344be13-95b6-48bc-bf2e-47db0b19368c",
241
+ @result=
242
+ {:code=>200,
243
+ :operation=>:audit,
244
+ :client_request=>
245
+ #<URI::HTTP http://pubsub.pubnub.com/v1/auth/audit/sub-key/sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f?channel=whatever&pnsdk=PubNub-Ruby%2F4.0.13&signature=724F4F024fhSolYgMc5dQrAGOY7tFZeo_2_XKxAvg0g%3D&timestamp=1479309113&uuid=96ba2f54-955c-4fd3-acb7-a8407dae2269>,
246
+ :server_response=>
247
+ #<HTTP::Message:0x007fc3240575f0
248
+ @http_body=
249
+ #<HTTP::Message::Body:0x007fc324057550
250
+ @body="{\"message\":\"Success\",\"payload\":{\"level\":\"channel\",\"subscribe_key\":\"sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f\",\"channels\":{}},\"service\":\"Access Manager\",\"status\":200}",
251
+ @chunk_size=nil,
252
+ @positions=nil,
253
+ @size=0>,
254
+ @http_header=
255
+ #<HTTP::Message::Headers:0x007fc3240575c8
256
+ @body_charset=nil,
257
+ @body_date=nil,
258
+ @body_encoding=#<Encoding:UTF-8>,
259
+ @body_size=0,
260
+ @body_type=nil,
261
+ @chunked=false,
262
+ @dumped=false,
263
+ @header_item=
264
+ [["Date", "Wed, 16 Nov 2016 15:11:54 GMT"],
265
+ ["Content-Type", "text/javascript; charset=UTF-8"],
266
+ ["Content-Length", "166"],
267
+ ["Connection", "keep-alive"],
268
+ ["Access-Control-Allow-Origin", "*"],
269
+ ["Access-Control-Allow-Methods", "GET"],
270
+ ["Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept"],
271
+ ["Cache-Control", "no-cache, no-store, must-revalidate"]],
272
+ @http_version="1.1",
273
+ @is_request=false,
274
+ @reason_phrase="OK",
275
+ @request_absolute_uri=nil,
276
+ @request_method="GET",
277
+ @request_query=nil,
278
+ @request_uri=
279
+ #<Addressable::URI:0x3fe19202be2c URI:http://pubsub.pubnub.com/v1/auth/audit/sub-key/sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f?channel=whatever&pnsdk=PubNub-Ruby%2F4.0.13&signature=724F4F024fhSolYgMc5dQrAGOY7tFZeo_2_XKxAvg0g%3D&timestamp=1479309113&uuid=96ba2f54-955c-4fd3-acb7-a8407dae2269>,
280
+ @status_code=200>,
281
+ @peer_cert=nil,
282
+ @previous=nil>,
283
+ :data=>{"level"=>"channel", "subscribe_key"=>"sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channels"=>{}}},
284
+ @status=
285
+ {:code=>200,
286
+ :client_request=>
287
+ #<URI::HTTP http://pubsub.pubnub.com/v1/auth/audit/sub-key/sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f?channel=whatever&pnsdk=PubNub-Ruby%2F4.0.13&signature=724F4F024fhSolYgMc5dQrAGOY7tFZeo_2_XKxAvg0g%3D&timestamp=1479309113&uuid=96ba2f54-955c-4fd3-acb7-a8407dae2269>,
288
+ :server_response=>
289
+ #<HTTP::Message:0x007fc3240575f0
290
+ @http_body=
291
+ #<HTTP::Message::Body:0x007fc324057550
292
+ @body="{\"message\":\"Success\",\"payload\":{\"level\":\"channel\",\"subscribe_key\":\"sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f\",\"channels\":{}},\"service\":\"Access Manager\",\"status\":200}",
293
+ @chunk_size=nil,
294
+ @positions=nil,
295
+ @size=0>,
296
+ @http_header=
297
+ #<HTTP::Message::Headers:0x007fc3240575c8
298
+ @body_charset=nil,
299
+ @body_date=nil,
300
+ @body_encoding=#<Encoding:UTF-8>,
301
+ @body_size=0,
302
+ @body_type=nil,
303
+ @chunked=false,
304
+ @dumped=false,
305
+ @header_item=
306
+ [["Date", "Wed, 16 Nov 2016 15:11:54 GMT"],
307
+ ["Content-Type", "text/javascript; charset=UTF-8"],
308
+ ["Content-Length", "166"],
309
+ ["Connection", "keep-alive"],
310
+ ["Access-Control-Allow-Origin", "*"],
311
+ ["Access-Control-Allow-Methods", "GET"],
312
+ ["Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept"],
313
+ ["Cache-Control", "no-cache, no-store, must-revalidate"]],
314
+ @http_version="1.1",
315
+ @is_request=false,
316
+ @reason_phrase="OK",
317
+ @request_absolute_uri=nil,
318
+ @request_method="GET",
319
+ @request_query=nil,
320
+ @request_uri=
321
+ #<Addressable::URI:0x3fe19202be2c URI:http://pubsub.pubnub.com/v1/auth/audit/sub-key/sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f?channel=whatever&pnsdk=PubNub-Ruby%2F4.0.13&signature=724F4F024fhSolYgMc5dQrAGOY7tFZeo_2_XKxAvg0g%3D&timestamp=1479309113&uuid=96ba2f54-955c-4fd3-acb7-a8407dae2269>,
322
+ @status_code=200>,
323
+ @peer_cert=nil,
324
+ @previous=nil>,
325
+ :category=>:ack,
326
+ :error=>false,
327
+ :auto_retried=>false,
328
+ :current_timetoken=>nil,
329
+ :last_timetoken=>nil,
330
+ :subscribed_channels=>nil,
331
+ :subscribed_channel_groups=>nil,
332
+ :data=>nil,
333
+ :config=>{:tls=>false, :uuid=>"96ba2f54-955c-4fd3-acb7-a8407dae2269", :auth_key=>nil, :origin=>"pubsub.pubnub.com"}},
334
+ @timetoken=nil>
335
+ ```
336
+
337
+ ## Channel Registration
338
+ For `:add` or `:remove` action:
339
+ Most important part: `status[:error]`
340
+ ```ruby
341
+ > #<Pubnub::Envelope:0x007fc3241472d0
342
+ @event=:channel_registration,
343
+ @event_options={:channel=>:whatever, :http_sync=>true, :group=>:whatever, :action=>:add, :callback=>nil},
344
+ @id="c1e64bb2-1965-4e69-817d-e46ef51c84b9",
345
+ @result=
346
+ {:data=>nil,
347
+ :code=>200,
348
+ :operation=>:channel_group_add,
349
+ :client_request=>
350
+ #<URI::HTTP http://pubsub.pubnub.com/v1/channel-registration/sub-key/sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f/channel-group/whatever?add=whatever&pnsdk=PubNub-Ruby%2F4.0.13&timestamp=1479309313&uuid=96ba2f54-955c-4fd3-acb7-a8407dae2269&signature=%2F32U%2F9t4ZKOfO3MbrsGFnosO8zLbQrYcMN86VL4sPgw%3D>,
351
+ :server_response=>
352
+ #<HTTP::Message:0x005571e1f29948
353
+ @http_body=#<HTTP::Message::Body:0x005571e1f29830 @body="{\"status\": 200, \"message\": \"OK\", \"service\": \"channel-registry\", \"error\": false}", @chunk_size=nil, @positions=nil, @size=0>,
354
+ @http_header=
355
+ #<HTTP::Message::Headers:0x005571e1f298f8
356
+ @body_charset=nil,
357
+ @body_date=nil,
358
+ @body_encoding=#<Encoding:UTF-8>,
359
+ @body_size=0,
360
+ @body_type=nil,
361
+ @chunked=false,
362
+ @dumped=false,
363
+ @header_item=
364
+ [["Date", "Wed, 16 Nov 2016 15:15:13 GMT"],
365
+ ["Content-Type", "text/javascript; charset=\"UTF-8\""],
366
+ ["Content-Length", "79"],
367
+ ["Connection", "keep-alive"],
368
+ ["Cache-Control", "no-cache"],
369
+ ["Access-Control-Allow-Origin", "*"],
370
+ ["Access-Control-Allow-Methods", "GET"],
371
+ ["Accept-Ranges", "bytes"],
372
+ ["Age", "0"],
373
+ ["Server", "Pubnub"]],
374
+ @http_version="1.1",
375
+ @is_request=false,
376
+ @reason_phrase="OK",
377
+ @request_absolute_uri=nil,
378
+ @request_method="GET",
379
+ @request_query=nil,
380
+ @request_uri=
381
+ #<Addressable::URI:0x3fe192080008 URI:http://pubsub.pubnub.com/v1/channel-registration/sub-key/sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f/channel-group/whatever?add=whatever&pnsdk=PubNub-Ruby%2F4.0.13&timestamp=1479309313&uuid=96ba2f54-955c-4fd3-acb7-a8407dae2269&signature=%2F32U%2F9t4ZKOfO3MbrsGFnosO8zLbQrYcMN86VL4sPgw%3D>,
382
+ @status_code=200>,
383
+ @peer_cert=nil,
384
+ @previous=nil>},
385
+ @status=
386
+ {:code=>200,
387
+ :operation=>:channel_group_add,
388
+ :client_request=>
389
+ #<URI::HTTP http://pubsub.pubnub.com/v1/channel-registration/sub-key/sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f/channel-group/whatever?add=whatever&pnsdk=PubNub-Ruby%2F4.0.13&timestamp=1479309313&uuid=96ba2f54-955c-4fd3-acb7-a8407dae2269&signature=%2F32U%2F9t4ZKOfO3MbrsGFnosO8zLbQrYcMN86VL4sPgw%3D>,
390
+ :server_response=>
391
+ #<HTTP::Message:0x005571e1f29948
392
+ @http_body=#<HTTP::Message::Body:0x005571e1f29830 @body="{\"status\": 200, \"message\": \"OK\", \"service\": \"channel-registry\", \"error\": false}", @chunk_size=nil, @positions=nil, @size=0>,
393
+ @http_header=
394
+ #<HTTP::Message::Headers:0x005571e1f298f8
395
+ @body_charset=nil,
396
+ @body_date=nil,
397
+ @body_encoding=#<Encoding:UTF-8>,
398
+ @body_size=0,
399
+ @body_type=nil,
400
+ @chunked=false,
401
+ @dumped=false,
402
+ @header_item=
403
+ [["Date", "Wed, 16 Nov 2016 15:15:13 GMT"],
404
+ ["Content-Type", "text/javascript; charset=\"UTF-8\""],
405
+ ["Content-Length", "79"],
406
+ ["Connection", "keep-alive"],
407
+ ["Cache-Control", "no-cache"],
408
+ ["Access-Control-Allow-Origin", "*"],
409
+ ["Access-Control-Allow-Methods", "GET"],
410
+ ["Accept-Ranges", "bytes"],
411
+ ["Age", "0"],
412
+ ["Server", "Pubnub"]],
413
+ @http_version="1.1",
414
+ @is_request=false,
415
+ @reason_phrase="OK",
416
+ @request_absolute_uri=nil,
417
+ @request_method="GET",
418
+ @request_query=nil,
419
+ @request_uri=
420
+ #<Addressable::URI:0x3fe192080008 URI:http://pubsub.pubnub.com/v1/channel-registration/sub-key/sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f/channel-group/whatever?add=whatever&pnsdk=PubNub-Ruby%2F4.0.13&timestamp=1479309313&uuid=96ba2f54-955c-4fd3-acb7-a8407dae2269&signature=%2F32U%2F9t4ZKOfO3MbrsGFnosO8zLbQrYcMN86VL4sPgw%3D>,
421
+ @status_code=200>,
422
+ @peer_cert=nil,
423
+ @previous=nil>,
424
+ :data=>nil,
425
+ :category=>:ack,
426
+ :error=>false,
427
+ :auto_retried=>false,
428
+ :current_timetoken=>nil,
429
+ :last_timetoken=>nil,
430
+ :subscribed_channels=>nil,
431
+ :subscribed_channel_groups=>nil,
432
+ :config=>{:tls=>false, :uuid=>"96ba2f54-955c-4fd3-acb7-a8407dae2269", :auth_key=>nil, :origin=>"pubsub.pubnub.com"}},
433
+ @timetoken=nil>
434
+ ```
435
+
436
+ For listings:
437
+ Most important part: `result[:data]`
438
+ ```ruby
439
+ #<Pubnub::Envelope:0x007fc3241de7e8
440
+ @event=:channel_registration,
441
+ @event_options={:channel=>:whatever, :http_sync=>true, :group=>:whatever, :action=>:get, :callback=>nil},
442
+ @id="c2c087df-5f92-4f63-98d7-98cffca6ee99",
443
+ @result=
444
+ {:data=>{"channels"=>["whatever"], "group"=>"whatever"},
445
+ :code=>200,
446
+ :operation=>:list_all_channels_in_channel_group,
447
+ :client_request=>
448
+ #<URI::HTTP http://pubsub.pubnub.com/v1/channel-registration/sub-key/sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f/channel-group/whatever?pnsdk=PubNub-Ruby%2F4.0.13&timestamp=1479309608&uuid=96ba2f54-955c-4fd3-acb7-a8407dae2269&signature=9tmmAHHVCDeS8qOV3qdkPZr11cnYWhXUrV475xBslWY%3D>,
449
+ :server_response=>
450
+ #<HTTP::Message:0x005571e1811f70
451
+ @http_body=
452
+ #<HTTP::Message::Body:0x005571e1810d78 @body="{\"status\": 200, \"payload\": {\"channels\": [\"whatever\"], \"group\": \"whatever\"}, \"service\": \"channel-registry\", \"error\": false}", @chunk_size=nil, @positions=nil, @size=0>,
453
+ @http_header=
454
+ #<HTTP::Message::Headers:0x005571e1811bb0
455
+ @body_charset=nil,
456
+ @body_date=nil,
457
+ @body_encoding=#<Encoding:UTF-8>,
458
+ @body_size=0,
459
+ @body_type=nil,
460
+ @chunked=false,
461
+ @dumped=false,
462
+ @header_item=
463
+ [["Date", "Wed, 16 Nov 2016 15:20:08 GMT"],
464
+ ["Content-Type", "text/javascript; charset=\"UTF-8\""],
465
+ ["Content-Length", "122"],
466
+ ["Connection", "keep-alive"],
467
+ ["Cache-Control", "no-cache"],
468
+ ["Access-Control-Allow-Origin", "*"],
469
+ ["Access-Control-Allow-Methods", "GET"],
470
+ ["Accept-Ranges", "bytes"],
471
+ ["Age", "0"],
472
+ ["Server", "Pubnub"]],
473
+ @http_version="1.1",
474
+ @is_request=false,
475
+ @reason_phrase="OK",
476
+ @request_absolute_uri=nil,
477
+ @request_method="GET",
478
+ @request_query=nil,
479
+ @request_uri=
480
+ #<Addressable::URI:0x2ab8f0c09d64 URI:http://pubsub.pubnub.com/v1/channel-registration/sub-key/sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f/channel-group/whatever?pnsdk=PubNub-Ruby%2F4.0.13&timestamp=1479309608&uuid=96ba2f54-955c-4fd3-acb7-a8407dae2269&signature=9tmmAHHVCDeS8qOV3qdkPZr11cnYWhXUrV475xBslWY%3D>,
481
+ @status_code=200>,
482
+ @peer_cert=nil,
483
+ @previous=nil>},
484
+ @status=
485
+ {:code=>200,
486
+ :operation=>:list_all_channels_in_channel_group,
487
+ :client_request=>
488
+ #<URI::HTTP http://pubsub.pubnub.com/v1/channel-registration/sub-key/sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f/channel-group/whatever?pnsdk=PubNub-Ruby%2F4.0.13&timestamp=1479309608&uuid=96ba2f54-955c-4fd3-acb7-a8407dae2269&signature=9tmmAHHVCDeS8qOV3qdkPZr11cnYWhXUrV475xBslWY%3D>,
489
+ :server_response=>
490
+ #<HTTP::Message:0x005571e1811f70
491
+ @http_body=
492
+ #<HTTP::Message::Body:0x005571e1810d78 @body="{\"status\": 200, \"payload\": {\"channels\": [\"whatever\"], \"group\": \"whatever\"}, \"service\": \"channel-registry\", \"error\": false}", @chunk_size=nil, @positions=nil, @size=0>,
493
+ @http_header=
494
+ #<HTTP::Message::Headers:0x005571e1811bb0
495
+ @body_charset=nil,
496
+ @body_date=nil,
497
+ @body_encoding=#<Encoding:UTF-8>,
498
+ @body_size=0,
499
+ @body_type=nil,
500
+ @chunked=false,
501
+ @dumped=false,
502
+ @header_item=
503
+ [["Date", "Wed, 16 Nov 2016 15:20:08 GMT"],
504
+ ["Content-Type", "text/javascript; charset=\"UTF-8\""],
505
+ ["Content-Length", "122"],
506
+ ["Connection", "keep-alive"],
507
+ ["Cache-Control", "no-cache"],
508
+ ["Access-Control-Allow-Origin", "*"],
509
+ ["Access-Control-Allow-Methods", "GET"],
510
+ ["Accept-Ranges", "bytes"],
511
+ ["Age", "0"],
512
+ ["Server", "Pubnub"]],
513
+ @http_version="1.1",
514
+ @is_request=false,
515
+ @reason_phrase="OK",
516
+ @request_absolute_uri=nil,
517
+ @request_method="GET",
518
+ @request_query=nil,
519
+ @request_uri=
520
+ #<Addressable::URI:0x2ab8f0c09d64 URI:http://pubsub.pubnub.com/v1/channel-registration/sub-key/sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f/channel-group/whatever?pnsdk=PubNub-Ruby%2F4.0.13&timestamp=1479309608&uuid=96ba2f54-955c-4fd3-acb7-a8407dae2269&signature=9tmmAHHVCDeS8qOV3qdkPZr11cnYWhXUrV475xBslWY%3D>,
521
+ @status_code=200>,
522
+ @peer_cert=nil,
523
+ @previous=nil>,
524
+ :data=>nil,
525
+ :category=>:ack,
526
+ :error=>false,
527
+ :auto_retried=>false,
528
+ :current_timetoken=>nil,
529
+ :last_timetoken=>nil,
530
+ :subscribed_channels=>nil,
531
+ :subscribed_channel_groups=>nil,
532
+ :config=>{:tls=>false, :uuid=>"96ba2f54-955c-4fd3-acb7-a8407dae2269", :auth_key=>nil, :origin=>"pubsub.pubnub.com"}},
533
+ @timetoken=nil>
534
+ ```
535
+
536
+ ## Grant / Revoke
537
+ Most important part: `status[:error]`
538
+
539
+ ```ruby
540
+ #<Pubnub::Envelope:0x007fc3242582c8
541
+ @event=:grant,
542
+ @event_options={:channel=>:whatever, :ttl=>3600, :http_sync=>true, :callback=>nil},
543
+ @id="a631994f-5c37-4a49-ba82-52b7aa2db685",
544
+ @result=
545
+ {:code=>200,
546
+ :operation=>:grant,
547
+ :client_request=>
548
+ #<URI::HTTP http://pubsub.pubnub.com/v1/auth/grant/sub-key/sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f?channel=whatever&m=1&pnsdk=PubNub-Ruby%2F4.0.13&r=1&signature=o-r78nncnqenn_LlJDoVzwP3jOhJKP2riKgcEZpbbCA%3D&timestamp=1479310015&ttl=3600&uuid=96ba2f54-955c-4fd3-acb7-a8407dae2269&w=1>,
549
+ :server_response=>
550
+ #<HTTP::Message:0x007fc32423a6b0
551
+ @http_body=
552
+ #<HTTP::Message::Body:0x007fc32423a610
553
+ @body=
554
+ "{\"message\":\"Success\",\"payload\":{\"level\":\"channel\",\"subscribe_key\":\"sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f\",\"ttl\":3600,\"channels\":{\"whatever\":{\"r\":1,\"w\":1,\"m\":1}}},\"service\":\"Access Manager\",\"status\":200}",
555
+ @chunk_size=nil,
556
+ @positions=nil,
557
+ @size=0>,
558
+ @http_header=
559
+ #<HTTP::Message::Headers:0x007fc32423a688
560
+ @body_charset=nil,
561
+ @body_date=nil,
562
+ @body_encoding=#<Encoding:UTF-8>,
563
+ @body_size=0,
564
+ @body_type=nil,
565
+ @chunked=false,
566
+ @dumped=false,
567
+ @header_item=
568
+ [["Date", "Wed, 16 Nov 2016 15:26:55 GMT"],
569
+ ["Content-Type", "text/javascript; charset=UTF-8"],
570
+ ["Content-Length", "207"],
571
+ ["Connection", "keep-alive"],
572
+ ["Access-Control-Allow-Origin", "*"],
573
+ ["Access-Control-Allow-Methods", "GET"],
574
+ ["Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept"],
575
+ ["Cache-Control", "no-cache, no-store, must-revalidate"]],
576
+ @http_version="1.1",
577
+ @is_request=false,
578
+ @reason_phrase="OK",
579
+ @request_absolute_uri=nil,
580
+ @request_method="GET",
581
+ @request_query=nil,
582
+ @request_uri=
583
+ #<Addressable::URI:0x3fe19211d678 URI:http://pubsub.pubnub.com/v1/auth/grant/sub-key/sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f?channel=whatever&m=1&pnsdk=PubNub-Ruby%2F4.0.13&r=1&signature=o-r78nncnqenn_LlJDoVzwP3jOhJKP2riKgcEZpbbCA%3D&timestamp=1479310015&ttl=3600&uuid=96ba2f54-955c-4fd3-acb7-a8407dae2269&w=1>,
584
+ @status_code=200>,
585
+ @peer_cert=nil,
586
+ @previous=nil>,
587
+ :data=>{"level"=>"channel", "subscribe_key"=>"sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "ttl"=>3600, "channels"=>{"whatever"=>{"r"=>1, "w"=>1, "m"=>1}}}},
588
+ @status=
589
+ {:code=>200,
590
+ :client_request=>
591
+ #<URI::HTTP http://pubsub.pubnub.com/v1/auth/grant/sub-key/sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f?channel=whatever&m=1&pnsdk=PubNub-Ruby%2F4.0.13&r=1&signature=o-r78nncnqenn_LlJDoVzwP3jOhJKP2riKgcEZpbbCA%3D&timestamp=1479310015&ttl=3600&uuid=96ba2f54-955c-4fd3-acb7-a8407dae2269&w=1>,
592
+ :server_response=>
593
+ #<HTTP::Message:0x007fc32423a6b0
594
+ @http_body=
595
+ #<HTTP::Message::Body:0x007fc32423a610
596
+ @body=
597
+ "{\"message\":\"Success\",\"payload\":{\"level\":\"channel\",\"subscribe_key\":\"sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f\",\"ttl\":3600,\"channels\":{\"whatever\":{\"r\":1,\"w\":1,\"m\":1}}},\"service\":\"Access Manager\",\"status\":200}",
598
+ @chunk_size=nil,
599
+ @positions=nil,
600
+ @size=0>,
601
+ @http_header=
602
+ #<HTTP::Message::Headers:0x007fc32423a688
603
+ @body_charset=nil,
604
+ @body_date=nil,
605
+ @body_encoding=#<Encoding:UTF-8>,
606
+ @body_size=0,
607
+ @body_type=nil,
608
+ @chunked=false,
609
+ @dumped=false,
610
+ @header_item=
611
+ [["Date", "Wed, 16 Nov 2016 15:26:55 GMT"],
612
+ ["Content-Type", "text/javascript; charset=UTF-8"],
613
+ ["Content-Length", "207"],
614
+ ["Connection", "keep-alive"],
615
+ ["Access-Control-Allow-Origin", "*"],
616
+ ["Access-Control-Allow-Methods", "GET"],
617
+ ["Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept"],
618
+ ["Cache-Control", "no-cache, no-store, must-revalidate"]],
619
+ @http_version="1.1",
620
+ @is_request=false,
621
+ @reason_phrase="OK",
622
+ @request_absolute_uri=nil,
623
+ @request_method="GET",
624
+ @request_query=nil,
625
+ @request_uri=
626
+ #<Addressable::URI:0x3fe19211d678 URI:http://pubsub.pubnub.com/v1/auth/grant/sub-key/sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f?channel=whatever&m=1&pnsdk=PubNub-Ruby%2F4.0.13&r=1&signature=o-r78nncnqenn_LlJDoVzwP3jOhJKP2riKgcEZpbbCA%3D&timestamp=1479310015&ttl=3600&uuid=96ba2f54-955c-4fd3-acb7-a8407dae2269&w=1>,
627
+ @status_code=200>,
628
+ @peer_cert=nil,
629
+ @previous=nil>,
630
+ :category=>:ack,
631
+ :error=>false,
632
+ :auto_retried=>false,
633
+ :current_timetoken=>nil,
634
+ :last_timetoken=>nil,
635
+ :subscribed_channels=>nil,
636
+ :subscribed_channel_groups=>nil,
637
+ :data=>nil,
638
+ :config=>{:tls=>false, :uuid=>"96ba2f54-955c-4fd3-acb7-a8407dae2269", :auth_key=>nil, :origin=>"pubsub.pubnub.com"}},
639
+ @timetoken=nil>
640
+ ```
641
+ ## HereNow
642
+ Most important part: `result[:data]`
643
+
644
+ ```ruby
645
+ #<Pubnub::Envelope:0x005571e3119f40
646
+ @event=:here_now,
647
+ @event_options={:channel=>:demo, :http_sync=>true, :callback=>nil},
648
+ @id="de7e1ff6-216d-4d3e-9b42-f1c83bd2fb39",
649
+ @result=
650
+ {:code=>200,
651
+ :operation=>:here_now,
652
+ :client_request=>
653
+ #<URI::HTTP http://pubsub.pubnub.com/v2/presence/sub-key/sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f/channel/demo?pnsdk=PubNub-Ruby%2F4.0.13&timestamp=1479310131&uuid=96ba2f54-955c-4fd3-acb7-a8407dae2269&signature=9%2F2CaKUvCvq5jhEEzz9LScQO0O8vo7SgYBkYeQv1jMs%3D>,
654
+ :server_response=>
655
+ #<HTTP::Message:0x005571e315cb38
656
+ @http_body=
657
+ #<HTTP::Message::Body:0x005571e315ca98 @body="{\"status\": 200, \"message\": \"OK\", \"service\": \"Presence\", \"uuids\": [\"96ba2f54-955c-4fd3-acb7-a8407dae2269\"], \"occupancy\": 1}", @chunk_size=nil, @positions=nil, @size=0>,
658
+ @http_header=
659
+ #<HTTP::Message::Headers:0x005571e315cb10
660
+ @body_charset=nil,
661
+ @body_date=nil,
662
+ @body_encoding=#<Encoding:UTF-8>,
663
+ @body_size=0,
664
+ @body_type=nil,
665
+ @chunked=false,
666
+ @dumped=false,
667
+ @header_item=
668
+ [["Date", "Wed, 16 Nov 2016 15:28:52 GMT"],
669
+ ["Content-Type", "text/javascript; charset=\"UTF-8\""],
670
+ ["Content-Length", "122"],
671
+ ["Connection", "keep-alive"],
672
+ ["Access-Control-Allow-Origin", "*"],
673
+ ["Access-Control-Allow-Methods", "OPTIONS, GET, POST"],
674
+ ["cache-control", "no-cache"],
675
+ ["Accept-Ranges", "bytes"],
676
+ ["Age", "0"],
677
+ ["Server", "Pubnub Presence"]],
678
+ @http_version="1.1",
679
+ @is_request=false,
680
+ @reason_phrase="OK",
681
+ @request_absolute_uri=nil,
682
+ @request_method="GET",
683
+ @request_query=nil,
684
+ @request_uri=
685
+ #<Addressable::URI:0x2ab8f18ae8bc URI:http://pubsub.pubnub.com/v2/presence/sub-key/sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f/channel/demo?pnsdk=PubNub-Ruby%2F4.0.13&timestamp=1479310131&uuid=96ba2f54-955c-4fd3-acb7-a8407dae2269&signature=9%2F2CaKUvCvq5jhEEzz9LScQO0O8vo7SgYBkYeQv1jMs%3D>,
686
+ @status_code=200>,
687
+ @peer_cert=nil,
688
+ @previous=nil>,
689
+ :data=>{:uuids=>["96ba2f54-955c-4fd3-acb7-a8407dae2269"], :occupancy=>1, :total_occupancy=>nil, :total_channels=>nil, :channels=>nil}},
690
+ @status=
691
+ {:code=>200,
692
+ :client_request=>
693
+ #<URI::HTTP http://pubsub.pubnub.com/v2/presence/sub-key/sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f/channel/demo?pnsdk=PubNub-Ruby%2F4.0.13&timestamp=1479310131&uuid=96ba2f54-955c-4fd3-acb7-a8407dae2269&signature=9%2F2CaKUvCvq5jhEEzz9LScQO0O8vo7SgYBkYeQv1jMs%3D>,
694
+ :server_response=>
695
+ #<HTTP::Message:0x005571e315cb38
696
+ @http_body=
697
+ #<HTTP::Message::Body:0x005571e315ca98 @body="{\"status\": 200, \"message\": \"OK\", \"service\": \"Presence\", \"uuids\": [\"96ba2f54-955c-4fd3-acb7-a8407dae2269\"], \"occupancy\": 1}", @chunk_size=nil, @positions=nil, @size=0>,
698
+ @http_header=
699
+ #<HTTP::Message::Headers:0x005571e315cb10
700
+ @body_charset=nil,
701
+ @body_date=nil,
702
+ @body_encoding=#<Encoding:UTF-8>,
703
+ @body_size=0,
704
+ @body_type=nil,
705
+ @chunked=false,
706
+ @dumped=false,
707
+ @header_item=
708
+ [["Date", "Wed, 16 Nov 2016 15:28:52 GMT"],
709
+ ["Content-Type", "text/javascript; charset=\"UTF-8\""],
710
+ ["Content-Length", "122"],
711
+ ["Connection", "keep-alive"],
712
+ ["Access-Control-Allow-Origin", "*"],
713
+ ["Access-Control-Allow-Methods", "OPTIONS, GET, POST"],
714
+ ["cache-control", "no-cache"],
715
+ ["Accept-Ranges", "bytes"],
716
+ ["Age", "0"],
717
+ ["Server", "Pubnub Presence"]],
718
+ @http_version="1.1",
719
+ @is_request=false,
720
+ @reason_phrase="OK",
721
+ @request_absolute_uri=nil,
722
+ @request_method="GET",
723
+ @request_query=nil,
724
+ @request_uri=
725
+ #<Addressable::URI:0x2ab8f18ae8bc URI:http://pubsub.pubnub.com/v2/presence/sub-key/sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f/channel/demo?pnsdk=PubNub-Ruby%2F4.0.13&timestamp=1479310131&uuid=96ba2f54-955c-4fd3-acb7-a8407dae2269&signature=9%2F2CaKUvCvq5jhEEzz9LScQO0O8vo7SgYBkYeQv1jMs%3D>,
726
+ @status_code=200>,
727
+ @peer_cert=nil,
728
+ @previous=nil>,
729
+ :data=>nil,
730
+ :category=>:ack,
731
+ :error=>false,
732
+ :auto_retried=>false,
733
+ :current_timetoken=>nil,
734
+ :last_timetoken=>nil,
735
+ :subscribed_channels=>nil,
736
+ :subscribed_channel_groups=>nil,
737
+ :config=>{:tls=>false, :uuid=>"96ba2f54-955c-4fd3-acb7-a8407dae2269", :auth_key=>nil, :origin=>"pubsub.pubnub.com"}},
738
+ @timetoken=nil>
739
+ ```
740
+
741
+ ## History
742
+ Most important part: `result[:data]`.
743
+
744
+ ```ruby
745
+ #<Pubnub::Envelope:0x005571e381db98
746
+ @event=:history,
747
+ @event_options={:channel=>:demo, :http_sync=>true, :count=>10, :callback=>nil},
748
+ @id="372317ac-ca93-46c1-913f-8e6fb020b73b",
749
+ @result=
750
+ {:code=>200,
751
+ :operation=>:history,
752
+ :client_request=>
753
+ #<URI::HTTP http://pubsub.pubnub.com/v2/history/sub-key/sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f/channel/demo?count=10&pnsdk=PubNub-Ruby%2F4.0.13&timestamp=1479310589&uuid=96ba2f54-955c-4fd3-acb7-a8407dae2269&signature=74Dczzz%2F8WxEVUP4shYHkXWsoUeBNzmDfOUcgI57BQ8%3D>,
754
+ :server_response=>
755
+ #<HTTP::Message:0x005571e3844bf8
756
+ @http_body=#<HTTP::Message::Body:0x005571e3844b58 @body="[[90,91,92,93,94,95,96,97,98,99],14793103373028625,14793103423331645]", @chunk_size=nil, @positions=nil, @size=0>,
757
+ @http_header=
758
+ #<HTTP::Message::Headers:0x005571e3844bd0
759
+ @body_charset=nil,
760
+ @body_date=nil,
761
+ @body_encoding=#<Encoding:UTF-8>,
762
+ @body_size=0,
763
+ @body_type=nil,
764
+ @chunked=false,
765
+ @dumped=false,
766
+ @header_item=
767
+ [["Date", "Wed, 16 Nov 2016 15:36:30 GMT"],
768
+ ["Content-Type", "text/javascript; charset=\"UTF-8\""],
769
+ ["Content-Length", "69"],
770
+ ["Connection", "keep-alive"],
771
+ ["Cache-Control", "no-cache"],
772
+ ["Access-Control-Allow-Origin", "*"],
773
+ ["Access-Control-Allow-Methods", "GET"],
774
+ ["Accept-Ranges", "bytes"],
775
+ ["Age", "0"],
776
+ ["Server", "Pubnub"]],
777
+ @http_version="1.1",
778
+ @is_request=false,
779
+ @reason_phrase="OK",
780
+ @request_absolute_uri=nil,
781
+ @request_method="GET",
782
+ @request_query=nil,
783
+ @request_uri=
784
+ #<Addressable::URI:0x2ab8f1c2291c URI:http://pubsub.pubnub.com/v2/history/sub-key/sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f/channel/demo?count=10&pnsdk=PubNub-Ruby%2F4.0.13&timestamp=1479310589&uuid=96ba2f54-955c-4fd3-acb7-a8407dae2269&signature=74Dczzz%2F8WxEVUP4shYHkXWsoUeBNzmDfOUcgI57BQ8%3D>,
785
+ @status_code=200>,
786
+ @peer_cert=nil,
787
+ @previous=nil>,
788
+ :data=>{:messages=>[90, 91, 92, 93, 94, 95, 96, 97, 98, 99], :end=>14793103423331645, :start=>14793103373028625}},
789
+ @status=
790
+ {:code=>200,
791
+ :client_request=>
792
+ #<URI::HTTP http://pubsub.pubnub.com/v2/history/sub-key/sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f/channel/demo?count=10&pnsdk=PubNub-Ruby%2F4.0.13&timestamp=1479310589&uuid=96ba2f54-955c-4fd3-acb7-a8407dae2269&signature=74Dczzz%2F8WxEVUP4shYHkXWsoUeBNzmDfOUcgI57BQ8%3D>,
793
+ :server_response=>
794
+ #<HTTP::Message:0x005571e3844bf8
795
+ @http_body=#<HTTP::Message::Body:0x005571e3844b58 @body="[[90,91,92,93,94,95,96,97,98,99],14793103373028625,14793103423331645]", @chunk_size=nil, @positions=nil, @size=0>,
796
+ @http_header=
797
+ #<HTTP::Message::Headers:0x005571e3844bd0
798
+ @body_charset=nil,
799
+ @body_date=nil,
800
+ @body_encoding=#<Encoding:UTF-8>,
801
+ @body_size=0,
802
+ @body_type=nil,
803
+ @chunked=false,
804
+ @dumped=false,
805
+ @header_item=
806
+ [["Date", "Wed, 16 Nov 2016 15:36:30 GMT"],
807
+ ["Content-Type", "text/javascript; charset=\"UTF-8\""],
808
+ ["Content-Length", "69"],
809
+ ["Connection", "keep-alive"],
810
+ ["Cache-Control", "no-cache"],
811
+ ["Access-Control-Allow-Origin", "*"],
812
+ ["Access-Control-Allow-Methods", "GET"],
813
+ ["Accept-Ranges", "bytes"],
814
+ ["Age", "0"],
815
+ ["Server", "Pubnub"]],
816
+ @http_version="1.1",
817
+ @is_request=false,
818
+ @reason_phrase="OK",
819
+ @request_absolute_uri=nil,
820
+ @request_method="GET",
821
+ @request_query=nil,
822
+ @request_uri=
823
+ #<Addressable::URI:0x2ab8f1c2291c URI:http://pubsub.pubnub.com/v2/history/sub-key/sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f/channel/demo?count=10&pnsdk=PubNub-Ruby%2F4.0.13&timestamp=1479310589&uuid=96ba2f54-955c-4fd3-acb7-a8407dae2269&signature=74Dczzz%2F8WxEVUP4shYHkXWsoUeBNzmDfOUcgI57BQ8%3D>,
824
+ @status_code=200>,
825
+ @peer_cert=nil,
826
+ @previous=nil>,
827
+ :category=>:ack,
828
+ :error=>false,
829
+ [18] pry(main)> p.history(channel: :demo, http_sync: true, count: 10)
830
+ => #<Pubnub::Envelope:0x005571e1c44070
831
+ @event=:history,
832
+ @event_options={:channel=>:demo, :http_sync=>true, :count=>10, :callback=>nil},
833
+ @id="50608c36-cecc-4e34-8213-b8183bb96da8",
834
+ @result=
835
+ {:code=>200,
836
+ :operation=>:history,
837
+ :client_request=>
838
+ #<URI::HTTP http://pubsub.pubnub.com/v2/history/sub-key/sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f/channel/demo?count=10&pnsdk=PubNub-Ruby%2F4.0.13&timestamp=1479310594&uuid=96ba2f54-955c-4fd3-acb7-a8407dae2269&signature=uPfZzcP%2F5OozLCtdFVXnzwhn84E1opPZNHhWtdDHoFg%3D>,
839
+ :server_response=>
840
+ #<HTTP::Message:0x005571e1c52760
841
+ @http_body=#<HTTP::Message::Body:0x005571e1c52620 @body="[[90,91,92,93,94,95,96,97,98,99],14793103373028625,14793103423331645]", @chunk_size=nil, @positions=nil, @size=0>,
842
+ @http_header=
843
+ #<HTTP::Message::Headers:0x005571e1c52698
844
+ @body_charset=nil,
845
+ @body_date=nil,
846
+ @body_encoding=#<Encoding:UTF-8>,
847
+ @body_size=0,
848
+ @body_type=nil,
849
+ @chunked=false,
850
+ @dumped=false,
851
+ @header_item=
852
+ [["Date", "Wed, 16 Nov 2016 15:36:34 GMT"],
853
+ ["Content-Type", "text/javascript; charset=\"UTF-8\""],
854
+ ["Content-Length", "69"],
855
+ ["Connection", "keep-alive"],
856
+ ["Cache-Control", "no-cache"],
857
+ ["Access-Control-Allow-Origin", "*"],
858
+ ["Access-Control-Allow-Methods", "GET"],
859
+ ["Accept-Ranges", "bytes"],
860
+ ["Age", "0"],
861
+ ["Server", "Pubnub"]],
862
+ @http_version="1.1",
863
+ @is_request=false,
864
+ @reason_phrase="OK",
865
+ @request_absolute_uri=nil,
866
+ @request_method="GET",
867
+ @request_query=nil,
868
+ @request_uri=
869
+ #<Addressable::URI:0x2ab8f0e29824 URI:http://pubsub.pubnub.com/v2/history/sub-key/sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f/channel/demo?count=10&pnsdk=PubNub-Ruby%2F4.0.13&timestamp=1479310594&uuid=96ba2f54-955c-4fd3-acb7-a8407dae2269&signature=uPfZzcP%2F5OozLCtdFVXnzwhn84E1opPZNHhWtdDHoFg%3D>,
870
+ @status_code=200>,
871
+ @peer_cert=nil,
872
+ @previous=nil>,
873
+ :data=>{:messages=>[90, 91, 92, 93, 94, 95, 96, 97, 98, 99], :end=>14793103423331645, :start=>14793103373028625}},
874
+ @status=
875
+ {:code=>200,
876
+ :client_request=>
877
+ #<URI::HTTP http://pubsub.pubnub.com/v2/history/sub-key/sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f/channel/demo?count=10&pnsdk=PubNub-Ruby%2F4.0.13&timestamp=1479310594&uuid=96ba2f54-955c-4fd3-acb7-a8407dae2269&signature=uPfZzcP%2F5OozLCtdFVXnzwhn84E1opPZNHhWtdDHoFg%3D>,
878
+ :server_response=>
879
+ #<HTTP::Message:0x005571e1c52760
880
+ @http_body=#<HTTP::Message::Body:0x005571e1c52620 @body="[[90,91,92,93,94,95,96,97,98,99],14793103373028625,14793103423331645]", @chunk_size=nil, @positions=nil, @size=0>,
881
+ @http_header=
882
+ #<HTTP::Message::Headers:0x005571e1c52698
883
+ @body_charset=nil,
884
+ @body_date=nil,
885
+ @body_encoding=#<Encoding:UTF-8>,
886
+ @body_size=0,
887
+ @body_type=nil,
888
+ @chunked=false,
889
+ @dumped=false,
890
+ @header_item=
891
+ [["Date", "Wed, 16 Nov 2016 15:36:34 GMT"],
892
+ ["Content-Type", "text/javascript; charset=\"UTF-8\""],
893
+ ["Content-Length", "69"],
894
+ ["Connection", "keep-alive"],
895
+ ["Cache-Control", "no-cache"],
896
+ ["Access-Control-Allow-Origin", "*"],
897
+ ["Access-Control-Allow-Methods", "GET"],
898
+ ["Accept-Ranges", "bytes"],
899
+ ["Age", "0"],
900
+ ["Server", "Pubnub"]],
901
+ @http_version="1.1",
902
+ @is_request=false,
903
+ @reason_phrase="OK",
904
+ @request_absolute_uri=nil,
905
+ @request_method="GET",
906
+ @request_query=nil,
907
+ @request_uri=
908
+ #<Addressable::URI:0x2ab8f0e29824 URI:http://pubsub.pubnub.com/v2/history/sub-key/sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f/channel/demo?count=10&pnsdk=PubNub-Ruby%2F4.0.13&timestamp=1479310594&uuid=96ba2f54-955c-4fd3-acb7-a8407dae2269&signature=uPfZzcP%2F5OozLCtdFVXnzwhn84E1opPZNHhWtdDHoFg%3D>,
909
+ @status_code=200>,
910
+ @peer_cert=nil,
911
+ @previous=nil>,
912
+ :category=>:ack,
913
+ :error=>false,
914
+ :auto_retried=>false,
915
+ :data=>nil,
916
+ :current_timetoken=>nil,
917
+ :last_timetoken=>nil,
918
+ :subscribed_channels=>nil,
919
+ :subscribed_channel_groups=>nil,
920
+ :config=>{:tls=>false, :uuid=>"96ba2f54-955c-4fd3-acb7-a8407dae2269", :auth_key=>nil, :origin=>"pubsub.pubnub.com"}},
921
+ @timetoken=nil>
922
+ ```
923
+
924
+ ## Leave
925
+ Most important part: `status[:error]`
926
+
927
+ ```ruby
928
+ #<Pubnub::Envelope:0x005571e2d9b7b0
929
+ @event=:leave,
930
+ @event_options={:channel=>:demo, :http_sync=>true, :callback=>nil},
931
+ @id="898e2c77-be07-4810-bd41-3ac3632331d8",
932
+ @result=nil,
933
+ @status=
934
+ {:code=>200,
935
+ :operation=>:leave,
936
+ :client_request=>
937
+ #<URI::HTTP http://pubsub.pubnub.com/v2/presence/sub-key/sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f/channel/demo/leave?pnsdk=PubNub-Ruby%2F4.0.13&timestamp=1479310804&uuid=96ba2f54-955c-4fd3-acb7-a8407dae2269&signature=MwJI5czAwWn4MZJdaj%2BAcJL61zX1j2l59OpT%2F4z02mI%3D>,
938
+ :server_response=>
939
+ #<HTTP::Message:0x005571e36d66b8
940
+ @http_body=#<HTTP::Message::Body:0x005571e36d6618 @body="{\"status\": 200, \"action\": \"leave\", \"message\": \"OK\", \"service\": \"Presence\"}", @chunk_size=nil, @positions=nil, @size=0>,
941
+ @http_header=
942
+ #<HTTP::Message::Headers:0x005571e36d6690
943
+ @body_charset=nil,
944
+ @body_date=nil,
945
+ @body_encoding=#<Encoding:UTF-8>,
946
+ @body_size=0,
947
+ @body_type=nil,
948
+ @chunked=false,
949
+ @dumped=false,
950
+ @header_item=
951
+ [["Date", "Wed, 16 Nov 2016 15:40:04 GMT"],
952
+ ["Content-Type", "text/javascript; charset=\"UTF-8\""],
953
+ ["Content-Length", "74"],
954
+ ["Connection", "keep-alive"],
955
+ ["Access-Control-Allow-Origin", "*"],
956
+ ["Access-Control-Allow-Methods", "OPTIONS, GET, POST"],
957
+ ["cache-control", "no-cache"],
958
+ ["Accept-Ranges", "bytes"],
959
+ ["Age", "0"],
960
+ ["Server", "Pubnub Presence"]],
961
+ @http_version="1.1",
962
+ @is_request=false,
963
+ @reason_phrase="OK",
964
+ @request_absolute_uri=nil,
965
+ @request_method="GET",
966
+ @request_query=nil,
967
+ @request_uri=
968
+ #<Addressable::URI:0x2ab8f1b6b6e0 URI:http://pubsub.pubnub.com/v2/presence/sub-key/sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f/channel/demo/leave?pnsdk=PubNub-Ruby%2F4.0.13&timestamp=1479310804&uuid=96ba2f54-955c-4fd3-acb7-a8407dae2269&signature=MwJI5czAwWn4MZJdaj%2BAcJL61zX1j2l59OpT%2F4z02mI%3D>,
969
+ @status_code=200>,
970
+ @peer_cert=nil,
971
+ @previous=nil>,
972
+ :data=>nil,
973
+ :category=>:ack,
974
+ :error=>false,
975
+ :auto_retried=>false,
976
+ :current_timetoken=>nil,
977
+ :last_timetoken=>nil,
978
+ :subscribed_channels=>nil,
979
+ :subscribed_channel_groups=>nil,
980
+ :config=>{:tls=>false, :uuid=>"96ba2f54-955c-4fd3-acb7-a8407dae2269", :auth_key=>nil, :origin=>"pubsub.pubnub.com"}},
981
+ @timetoken=nil>
982
+ ```
983
+
984
+ ## Publish
985
+ Most important part: `status[:error]`
986
+
987
+ ```ruby
988
+ #<Pubnub::Envelope:0x005571e33805b8
989
+ @event=:publish,
990
+ @event_options={:channel=>:demo, :message=>"hello!", :http_sync=>true, :callback=>nil},
991
+ @id="c1443a70-5ee5-4e5d-9498-d3d1442c4c20",
992
+ @result=nil,
993
+ @status=
994
+ {:code=>200,
995
+ :operation=>:publish,
996
+ :client_request=>
997
+ #<URI::HTTP http://pubsub.pubnub.com/publish/pub-c-b42cec2f-f468-4784-8833-dd2b074538c4/sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f/0/demo/0/%22hello%21%22?ortt=%7B%22t%22%3A14793109008755456%7D&pnsdk=PubNub-Ruby%2F4.0.13&seqn=101&timestamp=1479310900&uuid=96ba2f54-955c-4fd3-acb7-a8407dae2269&signature=Juqy8g4Bi%2FXgwhrUXN5NxqjMoROUyINRYPCzV%2B1s9o8%3D>,
998
+ :server_response=>
999
+ #<HTTP::Message:0x005571e341b4c8
1000
+ @http_body=#<HTTP::Message::Body:0x005571e341b428 @body="[1,\"Sent\",\"14793109009827627\"]", @chunk_size=nil, @positions=nil, @size=0>,
1001
+ @http_header=
1002
+ #<HTTP::Message::Headers:0x005571e341b4a0
1003
+ @body_charset=nil,
1004
+ @body_date=nil,
1005
+ @body_encoding=#<Encoding:UTF-8>,
1006
+ @body_size=0,
1007
+ @body_type=nil,
1008
+ @chunked=false,
1009
+ @dumped=false,
1010
+ @header_item=
1011
+ [["Date", "Wed, 16 Nov 2016 15:41:40 GMT"],
1012
+ ["Content-Type", "text/javascript; charset=\"UTF-8\""],
1013
+ ["Content-Length", "30"],
1014
+ ["Connection", "keep-alive"],
1015
+ ["Cache-Control", "no-cache"],
1016
+ ["Access-Control-Allow-Origin", "*"],
1017
+ ["Access-Control-Allow-Methods", "GET"]],
1018
+ @http_version="1.1",
1019
+ @is_request=false,
1020
+ @reason_phrase="OK",
1021
+ @request_absolute_uri=nil,
1022
+ @request_method="GET",
1023
+ @request_query=nil,
1024
+ @request_uri=
1025
+ #<Addressable::URI:0x2ab8f1a0dd84 URI:http://pubsub.pubnub.com/publish/pub-c-b42cec2f-f468-4784-8833-dd2b074538c4/sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f/0/demo/0/%22hello%21%22?ortt=%7B%22t%22%3A14793109008755456%7D&pnsdk=PubNub-Ruby%2F4.0.13&seqn=101&timestamp=1479310900&uuid=96ba2f54-955c-4fd3-acb7-a8407dae2269&signature=Juqy8g4Bi%2FXgwhrUXN5NxqjMoROUyINRYPCzV%2B1s9o8%3D>,
1026
+ @status_code=200>,
1027
+ @peer_cert=nil,
1028
+ @previous=nil>,
1029
+ :data=>nil,
1030
+ :category=>:ack,
1031
+ :error=>false,
1032
+ :auto_retried=>false,
1033
+ :current_timetoken=>nil,
1034
+ :last_timetoken=>nil,
1035
+ :subscribed_channels=>nil,
1036
+ :subscribed_channel_groups=>nil,
1037
+ :config=>{:tls=>false, :uuid=>"96ba2f54-955c-4fd3-acb7-a8407dae2269", :auth_key=>nil, :origin=>"pubsub.pubnub.com"}},
1038
+ @timetoken=nil>
1039
+ ```
1040
+
1041
+ ## SetState
1042
+ Most important part: `status[:error]`
1043
+
1044
+ ```ruby
1045
+ #<Pubnub::Envelope:0x005571e215cc88
1046
+ @event=:set_state,
1047
+ @event_options={:channel=>:demo, :state=>{:one=>1}, :http_sync=>true, :callback=>nil},
1048
+ @id="600bd479-8749-4278-8276-43cc7deca12a",
1049
+ @result=nil,
1050
+ @status=
1051
+ {:code=>200,
1052
+ :operation=>:set_state,
1053
+ :client_request=>
1054
+ #<URI::HTTP http://pubsub.pubnub.com/v2/presence/sub-key/sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f/channel/demo/uuid/96ba2f54-955c-4fd3-acb7-a8407dae2269/data?pnsdk=PubNub-Ruby%2F4.0.13&state=%7B%22one%22%3A1%7D&timestamp=1479310989&uuid=96ba2f54-955c-4fd3-acb7-a8407dae2269&signature=6LSIKJMxhTrSFbPWPfVEbQHuv%2BlK1Dt4zQwXb%2B5Lav8%3D>,
1055
+ :server_response=>
1056
+ #<HTTP::Message:0x005571e218a520
1057
+ @http_body=#<HTTP::Message::Body:0x005571e218a368 @body="{\"status\": 200, \"message\": \"OK\", \"payload\": {\"one\": 1}, \"service\": \"Presence\"}", @chunk_size=nil, @positions=nil, @size=0>,
1058
+ @http_header=
1059
+ #<HTTP::Message::Headers:0x005571e218a4f8
1060
+ @body_charset=nil,
1061
+ @body_date=nil,
1062
+ @body_encoding=#<Encoding:UTF-8>,
1063
+ @body_size=0,
1064
+ @body_type=nil,
1065
+ @chunked=false,
1066
+ @dumped=false,
1067
+ @header_item=
1068
+ [["Date", "Wed, 16 Nov 2016 15:43:10 GMT"],
1069
+ ["Content-Type", "text/javascript; charset=\"UTF-8\""],
1070
+ ["Content-Length", "78"],
1071
+ ["Connection", "keep-alive"],
1072
+ ["Access-Control-Allow-Origin", "*"],
1073
+ ["Access-Control-Allow-Methods", "OPTIONS, GET, POST"],
1074
+ ["cache-control", "no-cache"],
1075
+ ["Accept-Ranges", "bytes"],
1076
+ ["Age", "0"],
1077
+ ["Server", "Pubnub Presence"]],
1078
+ @http_version="1.1",
1079
+ @is_request=false,
1080
+ @reason_phrase="OK",
1081
+ @request_absolute_uri=nil,
1082
+ @request_method="GET",
1083
+ @request_query=nil,
1084
+ @request_uri=
1085
+ #<Addressable::URI:0x2ab8f10c5a10 URI:http://pubsub.pubnub.com/v2/presence/sub-key/sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f/channel/demo/uuid/96ba2f54-955c-4fd3-acb7-a8407dae2269/data?pnsdk=PubNub-Ruby%2F4.0.13&state=%7B%22one%22%3A1%7D&timestamp=1479310989&uuid=96ba2f54-955c-4fd3-acb7-a8407dae2269&signature=6LSIKJMxhTrSFbPWPfVEbQHuv%2BlK1Dt4zQwXb%2B5Lav8%3D>,
1086
+ @status_code=200>,
1087
+ @peer_cert=nil,
1088
+ @previous=nil>,
1089
+ :data=>nil,
1090
+ :category=>:ack,
1091
+ :error=>false,
1092
+ :auto_retried=>false,
1093
+ :current_timetoken=>nil,
1094
+ :last_timetoken=>nil,
1095
+ :subscribed_channels=>nil,
1096
+ :subscribed_channel_groups=>nil,
1097
+ :config=>{:tls=>false, :uuid=>"96ba2f54-955c-4fd3-acb7-a8407dae2269", :auth_key=>nil, :origin=>"pubsub.pubnub.com"}},
1098
+ @timetoken=nil>
1099
+ ```
1100
+
1101
+ ## State
1102
+ Most important part: `result[:data]`
1103
+ ```ruby
1104
+ #<Pubnub::Envelope:0x005571e36a9b40
1105
+ @event=:state,
1106
+ @event_options={:channel=>:demo, :http_sync=>true, :uuid=>"96ba2f54-955c-4fd3-acb7-a8407dae2269", :callback=>nil},
1107
+ @id="156996a8-1a9c-40d2-a6e5-239ddc583bef",
1108
+ @result=
1109
+ {:code=>200,
1110
+ :operation=>:get_state,
1111
+ :client_request=>
1112
+ #<URI::HTTP http://pubsub.pubnub.com/v2/presence/sub_key/sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f/channel/demo/uuid/96ba2f54-955c-4fd3-acb7-a8407dae2269?pnsdk=PubNub-Ruby%2F4.0.13&timestamp=1479311064&uuid=96ba2f54-955c-4fd3-acb7-a8407dae2269&signature=uC3RWRo4nbOB%2BOH32uiBh%2BYYVnkCu1KfHi9e1nuke5I%3D>,
1113
+ :server_response=>
1114
+ #<HTTP::Message:0x005571e3684480
1115
+ @http_body=
1116
+ #<HTTP::Message::Body:0x005571e36843e0
1117
+ @body="{\"status\": 200, \"uuid\": \"96ba2f54-955c-4fd3-acb7-a8407dae2269\", \"service\": \"Presence\", \"message\": \"OK\", \"payload\": {\"one\": 1}, \"channel\": \"demo\"}",
1118
+ @chunk_size=nil,
1119
+ @positions=nil,
1120
+ @size=0>,
1121
+ @http_header=
1122
+ #<HTTP::Message::Headers:0x005571e3684458
1123
+ @body_charset=nil,
1124
+ @body_date=nil,
1125
+ @body_encoding=#<Encoding:UTF-8>,
1126
+ @body_size=0,
1127
+ @body_type=nil,
1128
+ @chunked=false,
1129
+ @dumped=false,
1130
+ @header_item=
1131
+ [["Date", "Wed, 16 Nov 2016 15:44:24 GMT"],
1132
+ ["Content-Type", "text/javascript; charset=\"UTF-8\""],
1133
+ ["Content-Length", "145"],
1134
+ ["Connection", "keep-alive"],
1135
+ ["Access-Control-Allow-Origin", "*"],
1136
+ ["Access-Control-Allow-Methods", "OPTIONS, GET, POST"],
1137
+ ["cache-control", "no-cache"],
1138
+ ["Accept-Ranges", "bytes"],
1139
+ ["Age", "0"],
1140
+ ["Server", "Pubnub Presence"]],
1141
+ @http_version="1.1",
1142
+ @is_request=false,
1143
+ @reason_phrase="OK",
1144
+ @request_absolute_uri=nil,
1145
+ @request_method="GET",
1146
+ @request_query=nil,
1147
+ @request_uri=
1148
+ #<Addressable::URI:0x2ab8f1b42560 URI:http://pubsub.pubnub.com/v2/presence/sub_key/sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f/channel/demo/uuid/96ba2f54-955c-4fd3-acb7-a8407dae2269?pnsdk=PubNub-Ruby%2F4.0.13&timestamp=1479311064&uuid=96ba2f54-955c-4fd3-acb7-a8407dae2269&signature=uC3RWRo4nbOB%2BOH32uiBh%2BYYVnkCu1KfHi9e1nuke5I%3D>,
1149
+ @status_code=200>,
1150
+ @peer_cert=nil,
1151
+ @previous=nil>,
1152
+ :data=>{:state=>{"one"=>1}, :channel=>"demo"}},
1153
+ @status=
1154
+ {:code=>200,
1155
+ :client_request=>
1156
+ #<URI::HTTP http://pubsub.pubnub.com/v2/presence/sub_key/sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f/channel/demo/uuid/96ba2f54-955c-4fd3-acb7-a8407dae2269?pnsdk=PubNub-Ruby%2F4.0.13&timestamp=1479311064&uuid=96ba2f54-955c-4fd3-acb7-a8407dae2269&signature=uC3RWRo4nbOB%2BOH32uiBh%2BYYVnkCu1KfHi9e1nuke5I%3D>,
1157
+ :server_response=>
1158
+ #<HTTP::Message:0x005571e3684480
1159
+ @http_body=
1160
+ #<HTTP::Message::Body:0x005571e36843e0
1161
+ @body="{\"status\": 200, \"uuid\": \"96ba2f54-955c-4fd3-acb7-a8407dae2269\", \"service\": \"Presence\", \"message\": \"OK\", \"payload\": {\"one\": 1}, \"channel\": \"demo\"}",
1162
+ @chunk_size=nil,
1163
+ @positions=nil,
1164
+ @size=0>,
1165
+ @http_header=
1166
+ #<HTTP::Message::Headers:0x005571e3684458
1167
+ @body_charset=nil,
1168
+ @body_date=nil,
1169
+ @body_encoding=#<Encoding:UTF-8>,
1170
+ @body_size=0,
1171
+ @body_type=nil,
1172
+ @chunked=false,
1173
+ @dumped=false,
1174
+ @header_item=
1175
+ [["Date", "Wed, 16 Nov 2016 15:44:24 GMT"],
1176
+ ["Content-Type", "text/javascript; charset=\"UTF-8\""],
1177
+ ["Content-Length", "145"],
1178
+ ["Connection", "keep-alive"],
1179
+ ["Access-Control-Allow-Origin", "*"],
1180
+ ["Access-Control-Allow-Methods", "OPTIONS, GET, POST"],
1181
+ ["cache-control", "no-cache"],
1182
+ ["Accept-Ranges", "bytes"],
1183
+ ["Age", "0"],
1184
+ ["Server", "Pubnub Presence"]],
1185
+ @http_version="1.1",
1186
+ @is_request=false,
1187
+ @reason_phrase="OK",
1188
+ @request_absolute_uri=nil,
1189
+ @request_method="GET",
1190
+ @request_query=nil,
1191
+ @request_uri=
1192
+ #<Addressable::URI:0x2ab8f1b42560 URI:http://pubsub.pubnub.com/v2/presence/sub_key/sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f/channel/demo/uuid/96ba2f54-955c-4fd3-acb7-a8407dae2269?pnsdk=PubNub-Ruby%2F4.0.13&timestamp=1479311064&uuid=96ba2f54-955c-4fd3-acb7-a8407dae2269&signature=uC3RWRo4nbOB%2BOH32uiBh%2BYYVnkCu1KfHi9e1nuke5I%3D>,
1193
+ @status_code=200>,
1194
+ @peer_cert=nil,
1195
+ @previous=nil>,
1196
+ :data=>nil,
1197
+ :category=>:ack,
1198
+ :error=>false,
1199
+ :auto_retried=>false,
1200
+ :current_timetoken=>nil,
1201
+ :last_timetoken=>nil,
1202
+ :subscribed_channels=>nil,
1203
+ :subscribed_channel_groups=>nil,
1204
+ :config=>{:tls=>false, :uuid=>"96ba2f54-955c-4fd3-acb7-a8407dae2269", :auth_key=>nil, :origin=>"pubsub.pubnub.com"}},
1205
+ @timetoken=nil>
1206
+ ```
1207
+
1208
+ ## WhereNow
1209
+ Most important part: `result[:data]`
1210
+
1211
+ ```ruby
1212
+ #<Pubnub::Envelope:0x005571e32daf28
1213
+ @event=:where_now,
1214
+ @event_options={:uuid=>"96ba2f54-955c-4fd3-acb7-a8407dae2269", :http_sync=>true, :callback=>nil},
1215
+ @id="47066b73-40b2-4ed6-a314-8dd4e0ed9e80",
1216
+ @result=
1217
+ {:code=>200,
1218
+ :operation=>:where_now,
1219
+ :client_request=>
1220
+ #<URI::HTTP http://pubsub.pubnub.com/v2/presence/sub-key/sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f/uuid/96ba2f54-955c-4fd3-acb7-a8407dae2269?pnsdk=PubNub-Ruby%2F4.0.13&timestamp=1479310689&uuid=96ba2f54-955c-4fd3-acb7-a8407dae2269&signature=oI5hm2fo8oc7dBKyUkKKdklrjy87JI8rioFFMI2KLkM%3D>,
1221
+ :server_response=>
1222
+ #<HTTP::Message:0x005571e3205940
1223
+ @http_body=#<HTTP::Message::Body:0x005571e32058a0 @body="{\"status\": 200, \"message\": \"OK\", \"payload\": {\"channels\": [\"demo\"]}, \"service\": \"Presence\"}", @chunk_size=nil, @positions=nil, @size=0>,
1224
+ @http_header=
1225
+ #<HTTP::Message::Headers:0x005571e3205918
1226
+ @body_charset=nil,
1227
+ @body_date=nil,
1228
+ @body_encoding=#<Encoding:UTF-8>,
1229
+ @body_size=0,
1230
+ @body_type=nil,
1231
+ @chunked=false,
1232
+ @dumped=false,
1233
+ @header_item=
1234
+ [["Date", "Wed, 16 Nov 2016 15:38:09 GMT"],
1235
+ ["Content-Type", "text/javascript; charset=\"UTF-8\""],
1236
+ ["Content-Length", "90"],
1237
+ ["Connection", "keep-alive"],
1238
+ ["Access-Control-Allow-Origin", "*"],
1239
+ ["Access-Control-Allow-Methods", "OPTIONS, GET, POST"],
1240
+ ["cache-control", "no-cache"],
1241
+ ["Accept-Ranges", "bytes"],
1242
+ ["Age", "0"],
1243
+ ["Server", "Pubnub Presence"]],
1244
+ @http_version="1.1",
1245
+ @is_request=false,
1246
+ @reason_phrase="OK",
1247
+ @request_absolute_uri=nil,
1248
+ @request_method="GET",
1249
+ @request_query=nil,
1250
+ @request_uri=
1251
+ #<Addressable::URI:0x2ab8f1902fd4 URI:http://pubsub.pubnub.com/v2/presence/sub-key/sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f/uuid/96ba2f54-955c-4fd3-acb7-a8407dae2269?pnsdk=PubNub-Ruby%2F4.0.13&timestamp=1479310689&uuid=96ba2f54-955c-4fd3-acb7-a8407dae2269&signature=oI5hm2fo8oc7dBKyUkKKdklrjy87JI8rioFFMI2KLkM%3D>,
1252
+ @status_code=200>,
1253
+ @peer_cert=nil,
1254
+ @previous=nil>,
1255
+ :data=>{"channels"=>["demo"]}},
1256
+ @status=
1257
+ {:code=>200,
1258
+ :client_request=>
1259
+ #<URI::HTTP http://pubsub.pubnub.com/v2/presence/sub-key/sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f/uuid/96ba2f54-955c-4fd3-acb7-a8407dae2269?pnsdk=PubNub-Ruby%2F4.0.13&timestamp=1479310689&uuid=96ba2f54-955c-4fd3-acb7-a8407dae2269&signature=oI5hm2fo8oc7dBKyUkKKdklrjy87JI8rioFFMI2KLkM%3D>,
1260
+ :server_response=>
1261
+ #<HTTP::Message:0x005571e3205940
1262
+ @http_body=#<HTTP::Message::Body:0x005571e32058a0 @body="{\"status\": 200, \"message\": \"OK\", \"payload\": {\"channels\": [\"demo\"]}, \"service\": \"Presence\"}", @chunk_size=nil, @positions=nil, @size=0>,
1263
+ @http_header=
1264
+ #<HTTP::Message::Headers:0x005571e3205918
1265
+ @body_charset=nil,
1266
+ @body_date=nil,
1267
+ @body_encoding=#<Encoding:UTF-8>,
1268
+ @body_size=0,
1269
+ @body_type=nil,
1270
+ @chunked=false,
1271
+ @dumped=false,
1272
+ @header_item=
1273
+ [["Date", "Wed, 16 Nov 2016 15:38:09 GMT"],
1274
+ ["Content-Type", "text/javascript; charset=\"UTF-8\""],
1275
+ ["Content-Length", "90"],
1276
+ ["Connection", "keep-alive"],
1277
+ ["Access-Control-Allow-Origin", "*"],
1278
+ ["Access-Control-Allow-Methods", "OPTIONS, GET, POST"],
1279
+ ["cache-control", "no-cache"],
1280
+ ["Accept-Ranges", "bytes"],
1281
+ ["Age", "0"],
1282
+ ["Server", "Pubnub Presence"]],
1283
+ @http_version="1.1",
1284
+ @is_request=false,
1285
+ @reason_phrase="OK",
1286
+ @request_absolute_uri=nil,
1287
+ @request_method="GET",
1288
+ @request_query=nil,
1289
+ @request_uri=
1290
+ #<Addressable::URI:0x2ab8f1902fd4 URI:http://pubsub.pubnub.com/v2/presence/sub-key/sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f/uuid/96ba2f54-955c-4fd3-acb7-a8407dae2269?pnsdk=PubNub-Ruby%2F4.0.13&timestamp=1479310689&uuid=96ba2f54-955c-4fd3-acb7-a8407dae2269&signature=oI5hm2fo8oc7dBKyUkKKdklrjy87JI8rioFFMI2KLkM%3D>,
1291
+ @status_code=200>,
1292
+ @peer_cert=nil,
1293
+ @previous=nil>,
1294
+ :data=>nil,
1295
+ :category=>:ack,
1296
+ :error=>false,
1297
+ :auto_retried=>false,
1298
+ :current_timetoken=>nil,
1299
+ :last_timetoken=>nil,
1300
+ :subscribed_channels=>nil,
1301
+ :subscribed_channel_groups=>nil,
1302
+ :config=>{:tls=>false, :uuid=>"96ba2f54-955c-4fd3-acb7-a8407dae2269", :auth_key=>nil, :origin=>"pubsub.pubnub.com"}},
1303
+ @timetoken=nil>
1304
+ ```