lib/pubnub/events/grant.rb in pubnub-4.2.7 vs lib/pubnub/events/grant.rb in pubnub-4.3.0

- old
+ new

@@ -20,13 +20,20 @@ def parameters(signature = false) write = [0, '0', false].include?(@write) ? 0 : 1 read = [0, '0', false].include?(@read) ? 0 : 1 manage = [0, '0', false].include?(@manage) ? 0 : 1 # unless @group.blank? + if @delete.blank? + delete = nil + else + delete = [0, '0', false].include?(@delete) ? 0 : 1 + end + { timestamp: @timestamp, w: write, r: read, m: manage, + d: delete, ttl: @ttl }.delete_if { |_k, v| v.nil? }.merge(super(signature)) end def path '/' + [