{: rooto:"YARD::CodeObjects::RootObject:@childrenIC:&YARD::CodeObjects::CodeObjectList[o:#YARD::CodeObjects::ClassObject;IC;[o:$YARD::CodeObjects::MethodObject:@module_functionF: @scope: instance:@visibility: public: @pathI"Object#blank?:EF:@parameters[: @files[[I"lib/pubnub.rb;Ti:@current_file_has_commentsF: @name: blank?:@source_type: ruby: @tags[:@docstrings{:@docstringIC:YARD::Docstring" ;T: @object@ : @summary0:@hash_flagF:@ref_tags[;[o:YARD::Tags::Tag :@tag_nameI" return;F: @textI";T;0: @types[I" Boolean;T;@ : @allI";T:@unresolved_reference0:@namespace@:@signatureI"def blank?;T:@explicitT: @sourceI";def blank? respond_to?(:empty?) ? empty? : !self end;T: @dynamicTo; ; F; ; ;;;I"Object#present?;F;[;[[@i;F;: present?;;;[;{;IC;" ;T;@;0;F; [;[o;! ;"I" return;F;#I";T;0;$[I" Boolean;T;@;%I";T;&0;'@;(I"def present?;T;)T;*I"def present? !blank? end;T;+T: @owner@:@class_mixinsIC;[;-@:@instance_mixinsIC;[;-@:@attributesIC:SymbolHash{: classIC;1{:@symbolize_valueT; IC;1{;3T;3T: @aliases{: @groups[;[[@i;T;: Object;;;;;[;{;IC;"2Adding blank? and present? methods to Object. ;T; [;[;%I"2Adding blank? and present? methods to Object.;T;&0;@;F:@line_rangeo: Range: exclF: begini:endi;'@;I" Object;F:@superclasso:YARD::CodeObjects::Proxy : @imethod0:@origname0:@orignamespace0;:BasicObject;'@: @obj0: @type;2o:$YARD::CodeObjects::ModuleObject;IC;[/o; ; F; ;2;;;I"Pubnub.logger;F;[;[[@i ;F;: logger;;;[;{;IC;"*Returns the value of attribute logger ;T;@C;0;F; [;[;%I"*Returns the value of attribute logger;T;&0;'@A;(I"def logger;T;*I"def logger @logger end;T;+To; ; F; ;2;;;I"Pubnub.logger=;F;[[I" value;T0;[[@i ;F;: logger=;;;[;{;IC;"Sets the attribute logger ;T;@P;0;F; [;[o;! ;"I" param;F;#I".the value to set the attribute logger to.;T;I" value;T;$0;@P;%I"USets the attribute logger @param value the value to set the attribute logger to.;T;&0;'@A;(I"def logger=(value);T;*I"-def logger=(value) @logger = value end;T;+To; ; F; ;2;;;I"Pubnub.client;F;[;[[@i ;F;: client;;;[;{;IC;"*Returns the value of attribute client ;T;@c;0;F; [;[;%I"*Returns the value of attribute client;T;&0;'@A;(I"def client;T;*I"def client @client end;T;+To; ; F; ;2;;;I"Pubnub.client=;F;[[I" value;T0;[[@i ;F;: client=;;;[;{;IC;"Sets the attribute client ;T;@p;0;F; [;[o;! ;"I" param;F;#I".the value to set the attribute client to.;T;I" value;T;$0;@p;%I"USets the attribute client @param value the value to set the attribute client to.;T;&0;'@A;(I"def client=(value);T;*I"-def client=(value) @client = value end;T;+To; ; F; ;2;;;I"Pubnub.new;F;[[I" options;TI"{};T;[[@i#;T;:new;;;[;{;IC;"TODO: docs ;T; [;[;%I"TODO: docs;T;&0;@~;F;7o;8;9F;:i";;i";'@A;(I"def new(options = {});T;)T;*I" @group.join(',')) unless @group.blank? params.merge!(timestamp: @timestamp) params.merge!(channel: @channel.join(',')) unless @channel.first.blank? params.merge!(signature: signature) unless set_signature params end;T;+To; ; F; ; ;;;I"(Pubnub::PAM#variables_for_signature;F;[;[[@i(;F;:variables_for_signature;;;[;{;IC;" ;T;@;0;F; [;[;%I";T;&0;'@;(I" def variables_for_signature;T;)T;*I"def variables_for_signature parameters(true).map do|k, v| "#{k}=#{CGI.escape(v.to_s).gsub('+', '%20')}" end.sort.join('&') end;T;+To; ; F; ; ;;;I"!Pubnub::PAM#format_envelopes;F;[[I" response;T0;[[@i.;F;:format_envelopes;;;[;{;IC;" ;T;@;0;F; [;[;%I";T;&0;'@;(I"#def format_envelopes(response);T;)T;*I"def format_envelopes(response) parsed_response, error = Formatter.parse_json(response.body) error = response if parsed_response && response.code != '200' envelopes = if error [error_envelope(parsed_response, error)] else [valid_envelope(parsed_response)] end add_common_data_to_envelopes(envelopes, response) end;T;+To; ; F; ; ;;;I"Pubnub::PAM#valid_envelope;F;[[I"parsed_response;T0;[[@i<;F;:valid_envelope;;;[;{;IC;" ;T;@;0;F; [;[;%I";T;&0;'@;(I"(def valid_envelope(parsed_response);T;)T;*I"^def valid_envelope(parsed_response) Envelope.new( parsed_response: parsed_response, payload: parsed_response['payload'], service: parsed_response['service'], message: parsed_response['message'], status: parsed_response['status'], uuids: parsed_response['uuids'] ) end;T;+To; ; F; ; ;;;I"Pubnub::PAM#error_envelope;F;[[I"parsed_response;T0[I" error;T0;[[@iG;F;:error_envelope;;;[;{;IC;" ;T;@;0;F; [;[;%I";T;&0;'@;(I"/def error_envelope(parsed_response, error);T;)T;*I"def error_envelope(parsed_response, error) ErrorEnvelope.new( error: error, response_message: response_message(parsed_response), channel: @channel.first, timetoken: timetoken(parsed_response) ) end;T;+T;-@;.IC;[;-@;/IC;[;-@;0IC;1{;2IC;1{;3T; IC;1{;3T;3T;4{;5[;[[@i ;T;:PAM;;;;;[;{;IC;"?PAM module holds shared functionality for all PAM requests ;T; [;[;%I"?PAM module holds shared functionality for all PAM requests;T;&0;@;F;7o;8;9F;:i;;i;'@A;I"Pubnub::PAM;F;0;?0;@0;:SingleEvent;'@A;Bo; ;IC;[ o; ; F; ; ;: private;I"+Pubnub::SingleEvent#request_dispatcher;F;[;[[I"lib/pubnub/single_event.rb;Ti ;F;:request_dispatcher;;;[;{;IC;" ;T;@;0;F; [;[;%I";T;&0;'@;(I"def request_dispatcher;T;)T;*I"]def request_dispatcher @app.request_dispatcher(@origin, :single_event, @http_sync) end;T;+To; ; F; ; ;;S;I"'Pubnub::SingleEvent#finalize_event;F;[[I"_envelopes;T0;[[@i;T;:finalize_event;;;[;{;IC;"Just stubs ;T; [;[;%I"Just stubs;T;&0;@#;F;7o;8;9F;:i;;i;'@;(I"(def finalize_event(_envelopes); end;T;)T;*I"(def finalize_event(_envelopes); end;T;+To; ; F; ; ;;S;I"Pubnub::SingleEvent#path;F;[;[[@i;F;: path;;;[;{;IC;" ;T;@3;0;F; [;[;%I";T;&0;'@;(I"def path; end;T;)T;*I"def path; end;T;+To; ; F; ; ;;S;I""Pubnub::SingleEvent#timetoken;F;[[I"_parsed_response;T0;[[@i;F;:timetoken;;;[;{;IC;" ;T;@@;0;F; [;[;%I";T;&0;'@;(I")def timetoken(_parsed_response); end;T;)T;*I")def timetoken(_parsed_response); end;T;+To; ; F; ; ;;S;I")Pubnub::SingleEvent#response_message;F;[[I"_parsed_response;T0;[[@i;F;:response_message;;;[;{;IC;" ;T;@O;0;F; [;[;%I";T;&0;'@;(I"0def response_message(_parsed_response); end;T;)T;*I"0def response_message(_parsed_response); end;T;+To; ; F; ; ;;S;I")Pubnub::SingleEvent#format_envelopes;F;[[I"_response;T0;[[@i;F;;N;;;[;{;IC;" ;T;@^;0;F; [;[;%I";T;&0;'@;(I")def format_envelopes(_response); end;T;)T;*I")def format_envelopes(_response); end;T;+To; ; F; ; ;;S;I"'Pubnub::SingleEvent#valid_envelope;F;[[I"_parsed_response;T0;[[@i;F;;O;;;[;{;IC;" ;T;@m;0;F; [;[;%I";T;&0;'@;(I".def valid_envelope(_parsed_response); end;T;)T;*I".def valid_envelope(_parsed_response); end;T;+To; ; F; ; ;;S;I"'Pubnub::SingleEvent#error_envelope;F;[[I"_parsed_response;T0[I" _error;T0;[[@i;F;;P;;;[;{;IC;" ;T;@|;0;F; [;[;%I";T;&0;'@;(I"6def error_envelope(_parsed_response, _error); end;T;)T;*I"6def error_envelope(_parsed_response, _error); end;T;+T;-@;.IC;[;-@;/IC;[;-@;0IC;1{;2IC;1{;3T; IC;1{;3T;3T;4{;5[;[[@i ;T;;R;;;;;[;{;IC;"ESingleEvent module holds infrastructure for non-subscribe events ;T; [;[;%I"ESingleEvent module holds infrastructure for non-subscribe events;T;&0;@;F;7o;8;9F;:i;;i;'@A;I"Pubnub::SingleEvent;F;0;?0;@0;: Event;'@A;Bo; ;IC;[ o; ; F; ; ;;;I"Pubnub::Event#origin;F;[;[[I"lib/pubnub/event.rb;Ti ;F;: origin;;;[;{;IC;"*Returns the value of attribute origin ;T;@;0;F; [;[;%I"*Returns the value of attribute origin;T;&0;'@;(I"def origin;T;*I"def origin @origin end;T;+To; ; F; ; ;;;I"Pubnub::Event#callback;F;[;[[@i ;F;: callback;;;[;{;IC;",Returns the value of attribute callback ;T;@;0;F; [;[;%I",Returns the value of attribute callback;T;&0;'@;(I"def callback;T;*I"!def callback @callback end;T;+To; ; F; ; ;;;I"!Pubnub::Event#error_callback;F;[;[[@i ;F;:error_callback;;;[;{;IC;"2Returns the value of attribute error_callback ;T;@;0;F; [;[;%I"2Returns the value of attribute error_callback;T;&0;'@;(I"def error_callback;T;*I"-def error_callback @error_callback end;T;+To; ; F; ; ;;;I"Pubnub::Event#channel;F;[;[[@i ;F;: channel;;;[;{;IC;"+Returns the value of attribute channel ;T;@;0;F; [;[;%I"+Returns the value of attribute channel;T;&0;'@;(I"def channel;T;*I"def channel @channel end;T;+To; ; F; ; ;;;I"Pubnub::Event#open_timeout;F;[;[[@i ;F;:open_timeout;;;[;{;IC;"0Returns the value of attribute open_timeout ;T;@;0;F; [;[;%I"0Returns the value of attribute open_timeout;T;&0;'@;(I"def open_timeout;T;*I")def open_timeout @open_timeout end;T;+To; ; F; ; ;;;I"Pubnub::Event#read_timeout;F;[;[[@i ;F;:read_timeout;;;[;{;IC;"0Returns the value of attribute read_timeout ;T;@;0;F; [;[;%I"0Returns the value of attribute read_timeout;T;&0;'@;(I"def read_timeout;T;*I")def read_timeout @read_timeout end;T;+To; ; F; ; ;;;I"Pubnub::Event#idle_timeout;F;[;[[@i ;F;:idle_timeout;;;[;{;IC;"0Returns the value of attribute idle_timeout ;T;@;0;F; [;[;%I"0Returns the value of attribute idle_timeout;T;&0;'@;(I"def idle_timeout;T;*I")def idle_timeout @idle_timeout end;T;+To; ; F; ; ;;;I"Pubnub::Event#group;F;[;[[@i ;F;: group;;;[;{;IC;")Returns the value of attribute group ;T;@;0;F; [;[;%I")Returns the value of attribute group;T;&0;'@;(I"def group;T;*I"def group @group end;T;+To; ; F; ; ;;;I"$Pubnub::Event#presence_callback;F;[;[[@i ;F;:presence_callback;;;[;{;IC;"5Returns the value of attribute presence_callback ;T;@ ;0;F; [;[;%I"5Returns the value of attribute presence_callback;T;&0;'@;(I"def presence_callback;T;*I"3def presence_callback @presence_callback end;T;+To; ; F; ; ;;;I"Pubnub::Event#channels;F;[;[[@i;F;: channels;;;[;{;IC;"+Returns the value of attribute channel;T;@;0;F; [;[;%I",Returns the value of attribute channel ;T;&0;70;'@;(@;*I"def channel @channel end;T;+To; ; F; ; ;;;I"Pubnub::Event#initialize;F;[[I" options;T0[I"app;T0;[[@i;F;;J;;;[;{;IC;" ;T;@#;0;F; [;[o;! ;"I" return;F;#I"a new instance of Event;T;0;$[I" Event;F;@#;%I";T;&0;'@;(I"!def initialize(options, app);T;)T;*I"def initialize(options, app) @app = app create_variables_from_options(app.env.merge(options)) @origin = @app.current_origin format_channels format_group set_timestamp Pubnub.logger.debug('Pubnub::Event') { "Initialized #{self.class}" } end;T;+To; ; F; ; ;;;I"Pubnub::Event#fire;F;[;[[@i;F;: fire;;;[;{;IC;" ;T;@9;0;F; [;[;%I";T;&0;'@;(I" def fire;T;)T;*I"Kdef fire Pubnub.logger.debug('Pubnub::Event') { "Fired event #{self.class}" } sender = request_dispatcher message = sender.send_request(Celluloid::Actor.current) envelopes = fire_callbacks(handle(message)) finalize_event(envelopes) envelopes ensure sender.terminate if @http_sync terminate unless @stay_alive end;T;+To; ; F; ; ;;;I"Pubnub::Event#uri;F;[;[[@i*;F;:uri;;;[;{;IC;" ;T;@F;0;F; [;[;%I";T;&0;'@;(I" def uri;T;)T;*I"def uri uri = @ssl ? 'https://' : 'http://' uri += @origin uri += path uri += '?' + Formatter.params_hash_to_url_params(parameters) Pubnub.logger.debug('Pubnub::Event') { "Requested URI: #{uri}" } URI uri end;T;+To; ; F; ; ;;;I"Pubnub::Event#finalized?;F;[;[[@i3;F;:finalized?;;;[;{;IC;" ;T;@S;0;F; [;[o;! ;"I" return;F;#I";T;0;$[I" Boolean;T;@S;%I";T;&0;'@;(I"def finalized?;T;)T;*I"-def finalized? @finalized || @stop end;T;+To; ; F; ; ;;;I"Pubnub::Event#sync?;F;[;[[@i7;F;: sync?;;;[;{;IC;" ;T;@e;0;F; [;[o;! ;"I" return;F;#I";T;0;$[I" Boolean;T;@e;%I";T;&0;'@;(I"def sync?;T;)T;*I".def sync? @http_sync ? true : false end;T;+To; ; F; ; ;;S;I"Pubnub::Event#secure_call;F;[[I"cb;T0[I"arg;T0;[[@i=;F;:secure_call;;;[;{;IC;" ;T;@w;0;F; [;[;%I";T;&0;'@;(I"def secure_call(cb, arg);T;)T;*I"def secure_call(cb, arg) cb.call arg rescue => error Pubnub.logger.error('Pubnub::Event') { "Error while calling callback #{error.inspect}" } end;T;+To; ; F; ; ;;S;I""Pubnub::Event#format_channels;F;[;[[@iC;F;:format_channels;;;[;{;IC;" ;T;@;0;F; [;[;%I";T;&0;'@;(I"def format_channels;T;)T;*I"def format_channels @channel = Formatter.format_channel(@channel || @channels) @channel += Formatter.format_presence_channel(@presence) end;T;+To; ; F; ; ;;S;I"!Pubnub::Event#fire_callbacks;F;[[I"envelopes;T0;[[@iH;F;:fire_callbacks;;;[;{;IC;" ;T;@;0;F; [;[;%I";T;&0;'@;(I""def fire_callbacks(envelopes);T;)T;*I"Odef fire_callbacks(envelopes) Pubnub.logger.debug('Pubnub::Event') { "Firing callbacks for #{self.class}" } envelopes.each do |envelope| if !envelope.error && @callback && !envelope.timetoken_update secure_call @callback, envelope end secure_call(@error_callback, envelope) if envelope.error end envelopes end;T;+To; ; F; ; ;;S;I"Pubnub::Event#parameters;F;[;[[@iS;F;;L;;;[;{;IC;" ;T;@;0;F; [;[;%I";T;&0;'@;(I"def parameters;T;)T;*I"def parameters required = { pnsdk: "PubNub-Ruby/#{Pubnub::VERSION}" } empty_if_blank = { auth: @auth_key, uuid: @app.env[:uuid] } empty_if_blank.delete_if { |_k, v| v.blank? } required.merge(empty_if_blank) end;T;+To; ; F; ; ;;S;I"/Pubnub::Event#add_common_data_to_envelopes;F;[[I"envelopes;T0[I" response;T0;[[@ib;F;:!add_common_data_to_envelopes;;;[;{;IC;" ;T;@;0;F; [;[;%I";T;&0;'@;(I":def add_common_data_to_envelopes(envelopes, response);T;)T;*I"def add_common_data_to_envelopes(envelopes, response) Pubnub.logger.debug('Pubnub::Event') { 'Event#add_common_data_to_envelopes' } envelopes.each do |envelope| envelope.response = response.body envelope.object = response envelope.status = response.code.to_i envelope.mark_as_timetoken end envelopes.last.last = true if envelopes.last envelopes.first.first = true if envelopes.first envelopes end;T;+To; ; F; ; ;;S;I"Pubnub::Event#handle;F;[[I" response;T0;[[@ir;F;: handle;;;[;{;IC;" ;T;@;0;F; [;[;%I";T;&0;'@;(I"def handle(response);T;)T;*I"def handle(response) Pubnub.logger.debug('Pubnub::Event') { 'Event#handle' } @response = response @envelopes = format_envelopes response end;T;+To; ; F; ; ;;S;I"Pubnub::Event#connection;F;[;[[@iy;F;:connection;;;[;{;IC;" ;T;@;0;F; [;[;%I";T;&0;'@;(I"def connection;T;)T;*I"3def connection @app.connection_for(self) end;T;+To; ; F; ; ;;S;I"0Pubnub::Event#create_variables_from_options;F;[[I" options;T0;[[@i};F;:"create_variables_from_options;;;[;{;IC;" ;T;@;0;F; [;[;%I";T;&0;'@;(I"/def create_variables_from_options(options);T;)T;*I"9def create_variables_from_options(options) variables = %w(channel channels message http_sync callback connect_callback ssl cipher_key secret_key auth_key publish_key subscribe_key timetoken error_callback open_timeout read_timeout idle_timeout heartbeat group action read write manage ttl presence start end count reverse presence_callback) options = options.inject({}) { |memo, (k, v)| memo[k.to_sym] = v; memo } variables.each do |variable| instance_variable_set('@' + variable, options[variable.to_sym]) unless variable.nil? end if @event == :subscribe || @event == :presence @open_timeout = options[:s_open_timeout] @read_timeout = options[:s_read_timeout] @idle_timeout = options[:s_idle_timeout] end end;T;+To; ; F; ; ;;S;I"Pubnub::Event#format_group;F;[;[[@i;F;:format_group;;;[;{;IC;" ;T;@;0;F; [;[;%I";T;&0;'@;(I"def format_group;T;)T;*I"def format_group @group = Formatter.format_group(@group) if @group.first.to_s.count(':') > 0 @namespace_id, @group_id = @group.first.to_s.split(':') else @namespace_id = nil @group_id = @group.first.to_s end end;T;+To; ; F; ; ;;S;I" Pubnub::Event#set_timestamp;F;[;[[@i;T;:set_timestamp;;;[;{;IC;"5TODO: refactor this nicely and change test stubs ;T; [;[;%I"5TODO: refactor this nicely and change test stubs;T;&0;@;F;7o;8;9F;:i;;i;'@;(I"def set_timestamp;T;)T;*I"6def set_timestamp @timestamp = current_time end;T;+To; ; F; ; ;;S;I"Pubnub::Event#current_time;F;[;[[@i;F;:current_time;;;[;{;IC;" ;T;@;0;F; [;[;%I";T;&0;'@;(I"def current_time;T;)T;*I"+def current_time ::Time.now.to_i end;T;+To; ; F; ; ;;S;I"Pubnub::Event#encode_state;F;[[I" state;T0;[[@i;F;:encode_state;;;[;{;IC;" ;T;@;0;F; [;[;%I";T;&0;'@;(I"def encode_state(state);T;)T;*I"`def encode_state(state) URI.encode_www_form_component(state.to_json).gsub('+', '%20') end;T;+T;-@;.IC;[;-@;/IC;[;-@;0IC;1{;2IC;1{;3T; IC;1{;ZIC;1{: read@: write0;3T;[IC;1{;s@;t0;3T;\IC;1{;s@;t0;3T;]IC;1{;s@;t0;3T;^IC;1{;s@;t0;3T;_IC;1{;s@;t0;3T;`IC;1{;s@;t0;3T;aIC;1{;s@;t0;3T;bIC;1{;s@ ;t0;3T;3T;3T;4{@;];5[;[[@i ;T;;Y;;;;;[;{;IC;"Event module holds most basic and required infrastructure for every pubnub event, there are also SingleEvent module and SubscribeEvent module ;T; [;[;%I"Event module holds most basic and required infrastructure for every pubnub event, there are also SingleEvent module and SubscribeEvent module;T;&0;@;F;7o;8;9F;:i;;i ;'@A;I"Pubnub::Event;F;0;?0;@0;;6;'@;B@;C0;+T;C0;+T;C;2;+To;D;IC;[o; ; F; ;2;;;I"Pubnub::UUID.generate;F;[;[[I"lib/pubnub/uuid.rb;Ti ;F;: generate;;;[;{;IC;" ;T;@A;0;F; [;[;%I";T;&0;'@?;(I"def generate;T;)T;*I"def generate arr = Random.new.bytes(16).unpack('NnnnnN') arr[2] = (arr[2] & 0x0fff) | 0x4000 arr[3] = (arr[3] & 0x3fff) | 0x8000 sprintf('%08x-%04x-%04x-%04x-%04x%08x', *arr) end;T;+T;-@?;.IC;[;-@?;/IC;[;-@?;0IC;1{;2IC;1{;3T; IC;1{;3T;3T;4{;5[;[[@Fi ;T;: UUID;;;;;[;{;IC;"9Module used to generate new UUID number according to ;T; [;[;%I"9Module used to generate new UUID number according to;T;&0;@?;F;7o;8;9F;:i;;i;'@A;I"Pubnub::UUID;F;+To; ;IC;[ o; ; F; ; ;;;I"Pubnub::Error#env;F;[;[[I"lib/pubnub/error.rb;Ti ;F;:env;;;[;{;IC;"'Returns the value of attribute env ;T;@b;0;F; [;[;%I"'Returns the value of attribute env;T;&0;'@`;(I" def env;T;*I"def env @env end;T;+To; ; F; ; ;;;I"Pubnub::Error#message;F;[;[[@gi ;F;: message;;;[;{;IC;"+Returns the value of attribute message ;T;@p;0;F; [;[;%I"+Returns the value of attribute message;T;&0;'@`;(I"def message;T;*I"def message @message end;T;+To; ; F; ; ;;;I"Pubnub::Error#initialize;F;[[I"env;TI"{};T;[[@gi ;F;;J;;;[;{;IC;" ;T;@};0;F; [;[o;! ;"I" return;F;#I"a new instance of Error;T;0;$[I" Error;F;@};%I";T;&0;'@`;(I"def initialize(env = {});T;)T;*I"def initialize(env = {}) unless env.instance_of? Hash fail ::ArgumentError, 'Env passed to Pubnub::Error must be a hash' end @env = env @message = '' build_message log_error end;T;+To; ; F; ; ;;S;I" Pubnub::Error#build_message;F;[;[[@gi;F;:build_message;;;[;{;IC;" ;T;@;0;F; [;[;%I";T;&0;'@`;(I"def build_message;T;)T;*I"def build_message insert_value 'operation', @env[:operation] insert_value 'request', @env[:request] insert_value 'env', @env[:env] insert_value 'app', @env[:app] insert_value 'response', @env[:response] insert_value 'error type', @env[:error] insert_value 'error message', @env[:message] insert_value 'error backtrace', backtrace end;T;+To; ; F; ; ;;S;I"Pubnub::Error#insert_value;F;[[I"key;T0[I"val;T0;[[@gi';F;:insert_value;;;[;{;IC;" ;T;@;0;F; [;[;%I";T;&0;'@`;(I"def insert_value(key, val);T;)T;*I"Rdef insert_value(key, val) @message << "#{key.upcase}: #{val}\n" if val end;T;+To; ; F; ; ;;S;I"Pubnub::Error#log_error;F;[;[[@gi+;F;:log_error;;;[;{;IC;" ;T;@;0;F; [;[;%I";T;&0;'@`;(I"def log_error;T;)T;*I"Tdef log_error Pubnub.logger.error('Pubnub') { @message } if Pubnub.logger end;T;+T;-@`;.IC;[;-@`;/IC;[;-@`;0IC;1{;2IC;1{;3T; IC;1{;wIC;1{;s@b;t0;3T;xIC;1{;s@p;t0;3T;3T;3T;4{;5[;[[@gi ;T;: Error;;;;;[;{;IC;"+Some custom pubnub errors TODO: yardoc ;T; [;[;%I"+Some custom pubnub errors TODO: yardoc;T;&0;@`;F;7o;8;9F;:i;;i ;'@A;I"Pubnub::Error;F;0;?0;@0;:StandardError;'@A;B0;C;2;+To; ;IC;[;-@;.IC;[;-@;/IC;[;-@;0IC;1{;2IC;1{;3T; IC;1{;3T;3T;4{;5[;[[@gi0;F;:JSONParseError;;;;;[;{;IC;" ;T;@;0;F; [;[;%I";T;&0;'@A;I"Pubnub::JSONParseError;F;0;?0;@0;;|;'@A;B@`;C0;+To; ;IC;[;-@;.IC;[;-@;/IC;[;-@;0IC;1{;2IC;1{;3T; IC;1{;3T;3T;4{;5[;[[@gi1;F;:InitializationError;;;;;[;{;IC;" ;T;@;0;F; [;[;%I";T;&0;'@A;I" Pubnub::InitializationError;F;0;?0;@0;;|;'@A;B@`;C0;+To; ;IC;[;-@;.IC;[;-@;/IC;[;-@;0IC;1{;2IC;1{;3T; IC;1{;3T;3T;4{;5[;[[@gi2;F;:ArgumentError;;;;;[;{;IC;" ;T;@;0;F; [;[;%I";T;&0;'@A;I"Pubnub::ArgumentError;F;0;?0;@0;;|;'@A;B@`;C0;+To; ;IC;[;-@ ;.IC;[;-@ ;/IC;[;-@ ;0IC;1{;2IC;1{;3T; IC;1{;3T;3T;4{;5[;[[@gi3;F;:RequestError;;;;;[;{;IC;" ;T;@ ;0;F; [;[;%I";T;&0;'@A;I"Pubnub::RequestError;F;0;?0;@0;;|;'@A;B@`;C0;+To; ;IC;[;-@;.IC;[;-@;/IC;[;-@;0IC;1{;2IC;1{;3T; IC;1{;3T;3T;4{;5[;[[@gi4;F;:ResponseError;;;;;[;{;IC;" ;T;@;0;F; [;[;%I";T;&0;'@A;I"Pubnub::ResponseError;F;0;?0;@0;;|;'@A;B@`;C0;+T@o; ;IC;[o; ; F; ; ;;;I"Pubnub::Heart#initialize;F;[[I" options;T0;[[I"lib/pubnub/heart.rb;Ti ;F;;J;;;[;{;IC;" ;T;@2;0;F; [;[o;! ;"I" return;F;#I"a new instance of Heart;T;0;$[I" Heart;F;@2;%I";T;&0;'@0;(I"def initialize(options);T;)T;*I"|def initialize(options) @heartbeat = options[:heartbeat] @channel = options[:channel] @app = options[:app] end;T;+To; ; F; ; ;;;I" Pubnub::Heart#start_beating;F;[;[[@9i;F;:start_beating;;;[;{;IC;" ;T;@G;0;F; [;[;%I";T;&0;'@0;(I"def start_beating;T;)T;*I"def start_beating beating = Timers::Group.new beat beating.every(@heartbeat) do Pubnub.logger.debug('Pubnub') { 'Heartbeat!' } beat end loop { beating.wait } end;T;+To; ; F; ; ;;;I"Pubnub::Heart#beat;F;[;[[@9i;F;: beat;;;[;{;IC;" ;T;@T;0;F; [;[;%I";T;&0;'@0;(I" def beat;T;)T;*I"udef beat @app.heartbeat( channel: @channel, heartbeat: @heartbeat, http_sync: true ) end;T;+T;-@0;.IC;[;-@0;/IC;[o;= ;>0;?0;@0;:Celluloid;'@0;B0;C: module;-@0;0IC;1{;2IC;1{;3T; IC;1{;3T;3T;4{;5[;[[@9i ;T;: Heart;;;;;[;{;IC;"2Heart takes responsibility of heartbeat event ;T; [;[;%I"2Heart takes responsibility of heartbeat event;T;&0;@0;F;7o;8;9F;:i;;i;'@A;I"Pubnub::Heart;F;0;?0;@0;;6;'@;B@;C0;+To; ;IC;[#o; ; F; ; ;;;I"Pubnub::Client#env;F;[;[[I"lib/pubnub/client.rb;Ti=;F;;w;;;[;{;IC;"'Returns the value of attribute env ;T;@v;0;F; [;[;%I"'Returns the value of attribute env;T;&0;'@t;(I" def env;T;*I"def env @env end;T;+To:&YARD::CodeObjects::ConstantObject;[[@{i?;F;: VERSION;;;;;[;{;IC;" ;T;@;0;F; [;[;%I";T;&0;'@t;I"Pubnub::Client::VERSION;F;(I"VERSION = Pubnub::VERSION;T;*I"VERSION = Pubnub::VERSION;T: @valueI"Pubnub::VERSION;T;+To; ; F; ; ;;;I"Pubnub::Client#initialize;F;[[I" options;T0;[[@{iQ[I"lib/pubnub/client.rb;TiU[I"lib/pubnub/client.rb;TiT[I"lib/pubnub/client.rb;Til[I"lib/pubnub/client.rb;Tim[I"lib/pubnub/client.rb;Ti[I"lib/pubnub/client.rb;Ti{[I"lib/pubnub/client.rb;Ti[I"lib/pubnub/client.rb;Ti;T;;J;;;[;{;IC;" Parameters: ===========
subscribe_key
required. Your subscribe key.
publish_key
optional. Your publish key, without it you can't push messages.
secret_key
optional. Your secret key, required for PAM operations.
auth_key
optional. This client auth key.
cipher_key
optional. Required to encrypt messages.
uuid
optional. Sets given uuid as client uuid, does not generates random uuid on init as usually.
origin
optional. Specifies the fully qualified domain name of the PubNub origin. By default this value is set to pubsub.pubnub.com but it should be set to the appropriate origin specified in the PubNub Admin Portal.
callback
optional. Default callback function for all events if not overwrote while firing event.
error_callback
optional. Default error callback.
connect_callback
optional. Callback that is called when connection with origin is established.
ssl
optional. Your connection will use ssl if set to true.
heartbeat
optional. Heartbeat interval, if not set heartbeat will not be running.
subscribe_timeout
optional, be careful when modifying this. Timeout for subscribe connection in seconds.
non_subscribe_timeout
optional, be careful when modifying this. Timeout for non-subscribe connection in seconds.
max_retries
optional. How many times client should try to reestablish connection before fail.
ttl
optional. Default ttl for grant and revoke events.
_examples:_ ```ruby # Minimal initialize pubnub = Pubnub.new(subscribe_key: :my_sub_key) ```` ```ruby # More complex initialize pubnub = Pubnub.new( subscribe_key: :demo, publish_key: :demo, secret_key: :secret, cipher_key: :other_secret, uuid: :mad_max, origin: 'custom.pubnub.com', callback: -> (envelope) { puts envelope.message }, error_callback: -> (envelope) { puts envelope.message }, connect_callback: -> (message) { puts message }, heartbeat: 60, subscribe_timeout: 310, non_subscribe_timeout: 10, max_retries: 10, ttl: 0 ) ``` Returns: ======== Initialized Pubnub::Client prepared to be used. ;T; [;[o;! ;"I" return;F;#I"a new instance of Client;T;0;$[I" Client;F;@;%I" Parameters: ===========
subscribe_key
required. Your subscribe key.
publish_key
optional. Your publish key, without it you can't push messages.
secret_key
optional. Your secret key, required for PAM operations.
auth_key
optional. This client auth key.
cipher_key
optional. Required to encrypt messages.
uuid
optional. Sets given uuid as client uuid, does not generates random uuid on init as usually.
origin
optional. Specifies the fully qualified domain name of the PubNub origin. By default this value is set to pubsub.pubnub.com but it should be set to the appropriate origin specified in the PubNub Admin Portal.
callback
optional. Default callback function for all events if not overwrote while firing event.
error_callback
optional. Default error callback.
connect_callback
optional. Callback that is called when connection with origin is established.
ssl
optional. Your connection will use ssl if set to true.
heartbeat
optional. Heartbeat interval, if not set heartbeat will not be running.
subscribe_timeout
optional, be careful when modifying this. Timeout for subscribe connection in seconds.
non_subscribe_timeout
optional, be careful when modifying this. Timeout for non-subscribe connection in seconds.
max_retries
optional. How many times client should try to reestablish connection before fail.
ttl
optional. Default ttl for grant and revoke events.
_examples:_ ```ruby # Minimal initialize pubnub = Pubnub.new(subscribe_key: :my_sub_key) ```` ```ruby # More complex initialize pubnub = Pubnub.new( subscribe_key: :demo, publish_key: :demo, secret_key: :secret, cipher_key: :other_secret, uuid: :mad_max, origin: 'custom.pubnub.com', callback: -> (envelope) { puts envelope.message }, error_callback: -> (envelope) { puts envelope.message }, connect_callback: -> (message) { puts message }, heartbeat: 60, subscribe_timeout: 310, non_subscribe_timeout: 10, max_retries: 10, ttl: 0 ) ``` Returns: ======== Initialized Pubnub::Client prepared to be used. ;T;&0;@;F;7o;8;9F;:iA;;i;'@t;(I"def initialize(options);T;)T;*I"def initialize(options) env_hash = symbolize_options_keys(options) setup_app env_hash clean_env prepare_env validate! @env Pubnub.logger.debug('Pubnub::Client') do "Created new Pubnub::Client instance. Version: #{Pubnub::VERSION}" end end;T;+To; ; F; ; ;;;I"(Pubnub::Client#restart_subscription;F;[;[[@{i^[@ib[@ia[@iy[@iz[@i[@i[@i[@i;T;:restart_subscription;;;[;{;IC;"gKills currently running subscription and starts it again. Usable when @env[:origins_pool] changes. ;T; [;[;%I"gKills currently running subscription and starts it again. Usable when @env[:origins_pool] changes.;T;&0;@;F;7o;8;9F;:i;;i;'@t;(I"def restart_subscription;T;)T;*I"5def restart_subscription # TODO: implement end;T;+To; ; F; ; ;;;I"&Pubnub::Client#reset_subscription;F;[;[[@{ic[@ig[@if[@i~[@i[@i[@i[@i[@i;T;:reset_subscription;;;[;{;IC;":Same as #restart_subscription but set timetoken to 0. ;T; [;[;%I":Same as #restart_subscription but set timetoken to 0.;T;&0;@;F;7o;8;9F;:i;;i;'@t;(I"def reset_subscription;T;)T;*I"Jdef reset_subscription @env[:timetoken] = 0 # TODO: implement end;T;+To; ; F; ; ;;;I"Pubnub::Client#subscribed?;F;[;[[@{ij[@in[@im[@i[@i[@i[@i[@i[@i;T;:subscribed?;;;[;{;IC;"TODO: docs TODO: implement ;T; [;[o;! ;"I" return;F;#I";T;0;$[I" Boolean;T;@;%I"TODO: docs TODO: implement;T;&0;@;F;7o;8;9F;:i;;i;'@t;(I"def subscribed?;T;)T;*I"def subscribed? end;T;+To; ; F; ; ;;;I"&Pubnub::Client#request_dispatcher;F;[[I" origin;T0[I"event_type;T0[I" sync;T0;[[@{ir[@iv[@iu[@i[@i[@i[@i[@i[@i;T;;T;;;[;{;IC;"Returns appropriate RequestDispatcher. It returns always new RequestDispatcher for sync events. For async events it checks if there's already RequestDispatcher created and returns it if created, otherwise creates it, assigns it in @env and returns newly created dispatcher. ;T; [;[;%I"Returns appropriate RequestDispatcher. It returns always new RequestDispatcher for sync events. For async events it checks if there's already RequestDispatcher created and returns it if created, otherwise creates it, assigns it in @env and returns newly created dispatcher.;T;&0;@;F;7o;8;9F;:i;;i;'@t;(I"5def request_dispatcher(origin, event_type, sync);T;)T;*I"pdef request_dispatcher(origin, event_type, sync) Pubnub.logger.debug('Pubnub::Client') do "Looking for requester for #{event_type}" end if sync RequestDispatcher.new else @env[:req_dispatchers_pool] ||= {} @env[:req_dispatchers_pool][origin] ||= {} @env[:req_dispatchers_pool][origin][event_type] ||= RequestDispatcher.new end end;T;+To; ; F; ; ;;;I"+Pubnub::Client#kill_request_dispatcher;F;[[I" origin;T0[I"event_type;T0;[[@{i|[@i[@i[@i[@i[@i[@i[@i[@i;T;:kill_request_dispatcher;;;[;{;IC;"TODO: docs ;T; [;[;%I"TODO: docs;T;&0;@;F;7o;8;9F;:i;;i;'@t;(I"4def kill_request_dispatcher(origin, event_type);T;)T;*I"8def kill_request_dispatcher(origin, event_type) Pubnub.logger.debug('Pubnub::Client') { 'Killing requester' } @env[:req_dispatchers_pool][origin][event_type].async.terminate @env[:req_dispatchers_pool][origin][event_type] = nil rescue Pubnub.logger.debug('Pubnub::Client') { 'There\'s no requester' } end;T;+To; ; F; ; ;;;I"Pubnub::Client#change_uuid;F;[[I" uuid;T0;[[@{i[@i[@i[@i[@i[@i[@i[@i[@i;F;:change_uuid;;;[;{;IC;" ;T;@3;0;F; [;[;%I";T;&0;'@t;(I"def change_uuid(uuid);T;)T;*I"cdef change_uuid(uuid) leave_all if subscribed? @env[:uuid] = uuid reset_subscription end;T;+To; ; F; ; ;;;I"!Pubnub::Client#session_uuid=;F;[;[[@{i[@i[@i[@i[@i[@i[@i[@i[@i;F;:session_uuid=;;;[;{;IC;";T;@J;0;F; [;[;%I" ;T;&0;70;'@t;(@H;*I"cdef change_uuid(uuid) leave_all if subscribed? @env[:uuid] = uuid reset_subscription end;T;+To; ; F; ; ;;;I"Pubnub::Client#uuid=;F;[;[[@{i[@i[@i[@i[@i[@i[@i[@i[@i;F;: uuid=;;;[;{;IC;";T;@^;0;F; [;[;%I" ;T;&0;70;'@t;(@H;*I"cdef change_uuid(uuid) leave_all if subscribed? @env[:uuid] = uuid reset_subscription end;T;+To; ; F; ; ;;;I"Pubnub::Client#set_uuid=;F;[;[[@{i[@i[@i[@i[@i[@i[@i[@i[@i;F;:set_uuid=;;;[;{;IC;";T;@r;0;F; [;[;%I" ;T;&0;70;'@t;(@H;*I"cdef change_uuid(uuid) leave_all if subscribed? @env[:uuid] = uuid reset_subscription end;T;+To; ; F; ; ;;;I""Pubnub::Client#current_origin;F;[;[[@{i[@i[@i[@i[@i[@i[@i[@i[@i;T;:current_origin;;;[;{;IC;"TODO: docs ;T; [;[;%I"TODO: docs;T;&0;@;F;7o;8;9F;:i;;i;'@t;(I"def current_origin;T;)T;*I"7def current_origin @env[:origins_pool].first end;T;+To; ; F; ; ;;;I"Pubnub::Client#origin;F;[;[[@{i[@i[@i[@i[@i[@i[@i[@i[@i;F;;Z;;;[;{;IC;"TODO: docs;T;@;0;F; [;[;%I"TODO: docs ;T;&0;70;'@t;(@;*I"7def current_origin @env[:origins_pool].first end;T;+To; ; F; ; ;;;I"Pubnub::Client#timetoken;F;[;[[@{i[@i[@i[@i[@i[@i[@i[@i[@i;T;;W;;;[;{;IC;"TODO: docs ;T; [;[;%I"TODO: docs;T;&0;@;F;7o;8;9F;:i;;i;'@t;(I"def timetoken;T;)T;*I")def timetoken @env[:timetoken] end;T;+To; ; F; ; ;;;I"Pubnub::Client#timetoken=;F;[[I"timetoken;T0;[[@{i[@i[@i[@i[@i[@i[@i[@i[@i;T;:timetoken=;;;[;{;IC;"TODO: docs ;T; [;[;%I"TODO: docs;T;&0;@;F;7o;8;9F;:i;;i;'@t;(I"def timetoken=(timetoken);T;)T;*I"Adef timetoken=(timetoken) @env[:timetoken] = timetoken end;T;+To; ; F; ; ;;;I"Pubnub::Client#uuid;F;[;[[@{i[@i[@i[@i[@i[@i[@i[@i[@i;T;: uuid;;;[;{;IC;"TODO: docs ;T; [;[;%I"TODO: docs;T;&0;@;F;7o;8;9F;:i;;i;'@t;(I" def uuid;T;)T;*I"def uuid @env[:uuid] end;T;+To; ; F; ; ;;;I"Pubnub::Client#events;F;[;[[@{i[@i[@i[@i[@i[@i[@i[@i[@i;T;: events;;;[;{;IC;"TODO: docs ;T; [;[;%I"TODO: docs;T;&0;@;F;7o;8;9F;:i;;i;'@t;(I"def events;T;)T;*I"#def events @env[:events] end;T;+To; ; F; ; ;;S;I"Pubnub::Client#validate!;F;[[I"env;T0;[[@{i[@i[@i[@i[@i[@i[@i[@i[@i;F;:validate!;;;[;{;IC;" ;T;@ ;0;F; [;[;%I";T;&0;'@t;(I"def validate!(env);T;)T;*I"=def validate!(env) Validator::Client.validate! env end;T;+To; ; F; ; ;;S;I"Pubnub::Client#setup_app;F;[[I" options;T0;[[@{i[@i[@i[@i[@i[@i[@i[@i[@i;F;:setup_app;;;[;{;IC;" ;T;@!;0;F; [;[;%I";T;&0;'@t;(I"def setup_app(options);T;)T;*I"def setup_app(options) Pubnub.logger = options[:logger] || Logger.new('pubnub.log') Celluloid.logger = Pubnub.logger @env = options end;T;+To; ; F; ; ;;S;I"Pubnub::Client#prepare_env;F;[;[[@{i[@i[@i[@i[@i[@i[@i[@i[@i;F;:prepare_env;;;[;{;IC;" ;T;@8;0;F; [;[;%I";T;&0;'@t;(I"def prepare_env;T;)T;*I"^def prepare_env assign_defaults generate_uuid if @env[:uuid].blank? setup_pools end;T;+To; ; F; ; ;;S;I"!Pubnub::Client#generate_uuid;F;[;[[@{i[@i[@i[@i[@i[@i[@i[@i[@i;F;:generate_uuid;;;[;{;IC;" ;T;@M;0;F; [;[;%I";T;&0;'@t;(I"def generate_uuid;T;)T;*I"8def generate_uuid @env[:uuid] = UUID.generate end;T;+To; ; F; ; ;;S;I"#Pubnub::Client#assign_defaults;F;[;[[@{i[@i[@i[@i[@i[@i[@i[@i[@i;F;:assign_defaults;;;[;{;IC;" ;T;@b;0;F; [;[;%I";T;&0;'@t;(I"def assign_defaults;T;)T;*I"adef assign_defaults default_values.each do |k, v| @env[k] = v unless @env[k] end end;T;+To; ; F; ; ;;S;I"Pubnub::Client#setup_pools;F;[;[[@{i[@i[@i[@i[@i[@i[@i[@i[@i;F;:setup_pools;;;[;{;IC;" ;T;@w;0;F; [;[;%I";T;&0;'@t;(I"def setup_pools;T;)T;*I"def setup_pools # Event pool @env[:events] = [] # Connection pools @env[:single_event_conn_pool] = {} @env[:subscribe_event_conn_pool] = {} @env[:heartbeat_event_conn_pool] = {} # Callback pools. @env[:c_cb_pool] = {} @env[:e_cb_pool] = {} # Subscription and heartbeat pools. @env[:subscription_pool] = {} @env[:heartbeat_pool] = {} # Requests pool. @env[:req_dispatchers_pool] = {} end;T;+To; ; F; ; ;;S;I"*Pubnub::Client#symbolize_options_keys;F;[[I" options;T0;[[@{i[@i[@i[@i[@i[@i[@i[@i[@i;F;:symbolize_options_keys;;;[;{;IC;" ;T;@;0;F; [;[;%I";T;&0;'@t;(I"(def symbolize_options_keys(options);T;)T;*I"def symbolize_options_keys(options) symbolized_options = {} options.each_key do |k| symbolized_options.merge!(k.to_sym => options[k]) end symbolized_options end;T;+To; ; F; ; ;;S;I""Pubnub::Client#default_values;F;[;[[@{i[@i[@i[@i[@i[@i[@i[@i[@i!;F;:default_values;;;[;{;IC;" ;T;@;0;F; [;[;%I";T;&0;'@t;(I"def default_values;T;)T;*I"def default_values { origins_pool: DEFAULT_ORIGINS_POOL, error_callback: DEFAULT_ERROR_CALLBACK, connection_callback: DEFAULT_CONNECT_CALLBACK, open_timeout: DEFAULT_OPEN_TIMEOUT, read_timeout: DEFAULT_READ_TIMEOUT, idle_timeout: DEFAULT_IDLE_TIMEOUT, s_open_timeout: DEFAULT_S_OPEN_TIMEOUT, s_read_timeout: DEFAULT_S_READ_TIMEOUT, s_idle_timeout: DEFAULT_S_IDLE_TIMEOUT } end;T;+To; ; F; ; ;;S;I"Pubnub::Client#clean_env;F;[;[[@{i[@i[@i[@i[@i[@i[@i[@i"[@i-;F;:clean_env;;;[;{;IC;" ;T;@;0;F; [;[;%I";T;&0;'@t;(I"def clean_env;T;)T;*I"Ndef clean_env @env.delete_if { |_, v| v.blank? } # nillify if blank end;T;+To;D;IC;[o;;[[I" lib/pubnub/client/events.rb;Ti ;F;: EVENTS;;;;;[;{;IC;" ;T;@;0;F; [;[;%I";T;&0;'@;I"#Pubnub::Client::Events::EVENTS;F;(I"NEVENTS = %w(publish subscribe presence leave history here_now audit grant;T;*I"EVENTS = %w(publish subscribe presence leave history here_now audit grant revoke time heartbeat where_now state channel_registration);T;I"|%w(publish subscribe presence leave history here_now audit grant revoke time heartbeat where_now state channel_registration);T;+T;-@;.IC;[;-@;/IC;[;-@;0IC;1{;2IC;1{;3T; IC;1{;3T;3T;4{;5[;[[@i ;T;: Events;;;;;[;{;IC;"/Module that holds generator for all events ;T; [;[;%I"/Module that holds generator for all events;T;&0;@;F;7o;8;9F;:i ;;i ;'@t;I"Pubnub::Client::Events;F;+To;D;IC;[o; ; F; ; ;;;I"/Pubnub::Client::Connections#setup_conn_for;F;[[I" event;T0;[[I"%lib/pubnub/client/connections.rb;Ti ;F;:setup_conn_for;;;[;{;IC;" ;T;@;0;F; [;[;%I";T;&0;'@;(I"def setup_conn_for(event);T;)T;*I"def setup_conn_for(event) if event.is_a? SingleEvent setup_conn_for_single_event(event) elsif event.is_a? SubscribeEvent setup_conn_for_subscribe_event(event) end begin @env[:connection_callback].call 'Connected!' if @env[:connection_callback] rescue => error Pubnub.logger.error('Pubnub::Client') do "Error while calling connection callback #{error.inspect}" end end end;T;+To; ; F; ; ;;S;I" channel, :http_sync => true, :count => limit, :start => current_start_tt, :end => end_tt) envelopes.flatten! Pubnub.logger.debug('Pubnub::Client'){"\n\nHistroy start: #{envelopes.last.history_start}"} Pubnub.logger.debug('Pubnub::Client'){"History end: #{envelopes.last.history_end}\n"} current_start_tt = envelopes.last.history_start.to_i unless i == page - 1 envelopes = [] end end envelopes.flatten! envelopes.each do |envelope| callback.call envelope end if callback envelopes else Celluloid::Future.new do sync_options = options.dup sync_options[:http_sync] = true self.paged_history(sync_options, &block) end end end;T;+T;-@;.IC;[;-@;/IC;[;-@;0IC;1{;2IC;1{;3T; IC;1{;3T;3T;4{;5[;[[@i ;T;:PagedHistory;;;;;[;{;IC;"/Module that holds generator for all events ;T; [;[;%I"/Module that holds generator for all events;T;&0;@;F;7o;8;9F;:i ;;i ;'@t;I"!Pubnub::Client::PagedHistory;F;+T;-@t;.IC;[;-@t;/IC;[ o;= ;>0;?0;@0;;;'@t;B@;C;o;= ;>0;?0;@0;;;'@t;B@;C;o;= ;>0;?0;@0;;;'@t;B@;C;o;= ;>0;?0;@0;:Configuration;'@A;Bo;D;IC;[o;;[[I" lib/pubnub/configuration.rb;Ti ;F;:DEFAULT_ERROR_CALLBACK;;;;;[;{;IC;" ;T;@;0;F; [;[;%I";T;&0;'@;I"2Pubnub::Configuration::DEFAULT_ERROR_CALLBACK;F;(I"FDEFAULT_ERROR_CALLBACK = ->(err) { puts err.inspect };T;*I"FDEFAULT_ERROR_CALLBACK = ->(err) { puts err.inspect };T;I"!->(err) { puts err.inspect };T;+To;;[[@i ;F;:DEFAULT_CONNECT_CALLBACK;;;;;[;{;IC;" ;T;@;0;F; [;[;%I";T;&0;'@;I"4Pubnub::Configuration::DEFAULT_CONNECT_CALLBACK;F;(I"ADEFAULT_CONNECT_CALLBACK = ->(msg) { msg.inspect };T;*I"ADEFAULT_CONNECT_CALLBACK = ->(msg) { msg.inspect };T;I"->(msg) { msg.inspect };T;+To;;[[@i ;T;:DEFAULT_READ_TIMEOUT;;;;;[;{;IC;"!TODO: check default timeouts ;T; [;[;%I"!TODO: check default timeouts;T;&0;@;F;7o;8;9F;:i ;;i ;'@;I"0Pubnub::Configuration::DEFAULT_READ_TIMEOUT;F;(I",DEFAULT_READ_TIMEOUT = 10;T;*I",DEFAULT_READ_TIMEOUT = 10;T;I"10;T;+To;;[[@i;F;:DEFAULT_OPEN_TIMEOUT;;;;;[;{;IC;" ;T;@;0;F; [;[;%I";T;&0;'@;I"0Pubnub::Configuration::DEFAULT_OPEN_TIMEOUT;F;(I",DEFAULT_OPEN_TIMEOUT = 10;T;*I",DEFAULT_OPEN_TIMEOUT = 10;T;I"10;T;+To;;[[@i;F;:DEFAULT_IDLE_TIMEOUT;;;;;[;{;IC;" ;T;@;0;F; [;[;%I";T;&0;'@;I"0Pubnub::Configuration::DEFAULT_IDLE_TIMEOUT;F;(I",DEFAULT_IDLE_TIMEOUT = 10;T;*I",DEFAULT_IDLE_TIMEOUT = 10;T;I"10;T;+To;;[[@i;F;:DEFAULT_S_READ_TIMEOUT;;;;;[;{;IC;" ;T;@;0;F; [;[;%I";T;&0;'@;I"2Pubnub::Configuration::DEFAULT_S_READ_TIMEOUT;F;(I"-DEFAULT_S_READ_TIMEOUT = 310;T;*I"-DEFAULT_S_READ_TIMEOUT = 310;T;I"310;T;+To;;[[@i;F;:DEFAULT_S_OPEN_TIMEOUT;;;;;[;{;IC;" ;T;@;0;F; [;[;%I";T;&0;'@;I"2Pubnub::Configuration::DEFAULT_S_OPEN_TIMEOUT;F;(I"-DEFAULT_S_OPEN_TIMEOUT = 310;T;*I"-DEFAULT_S_OPEN_TIMEOUT = 310;T;I"310;T;+To;;[[@i;F;:DEFAULT_S_IDLE_TIMEOUT;;;;;[;{;IC;" ;T;@ ;0;F; [;[;%I";T;&0;'@;I"2Pubnub::Configuration::DEFAULT_S_IDLE_TIMEOUT;F;(I"-DEFAULT_S_IDLE_TIMEOUT = 310;T;*I"-DEFAULT_S_IDLE_TIMEOUT = 310;T;I"310;T;+To;;[[@i;F;:DEFAULT_H_READ_TIMEOUT;;;;;[;{;IC;" ;T;@;0;F; [;[;%I";T;&0;'@;I"2Pubnub::Configuration::DEFAULT_H_READ_TIMEOUT;F;(I",DEFAULT_H_READ_TIMEOUT = 10;T;*I",DEFAULT_H_READ_TIMEOUT = 10;T;I"10;T;+To;;[[@i;F;:DEFAULT_H_OPEN_TIMEOUT;;;;;[;{;IC;" ;T;@&;0;F; [;[;%I";T;&0;'@;I"2Pubnub::Configuration::DEFAULT_H_OPEN_TIMEOUT;F;(I",DEFAULT_H_OPEN_TIMEOUT = 10;T;*I",DEFAULT_H_OPEN_TIMEOUT = 10;T;I"10;T;+To;;[[@i;F;:DEFAULT_H_IDLE_TIMEOUT;;;;;[;{;IC;" ;T;@3;0;F; [;[;%I";T;&0;'@;I"2Pubnub::Configuration::DEFAULT_H_IDLE_TIMEOUT;F;(I",DEFAULT_H_IDLE_TIMEOUT = 10;T;*I",DEFAULT_H_IDLE_TIMEOUT = 10;T;I"10;T;+To;;[[@i;F;:DEFAULT_RECONNECT_ATTEMPTS;;;;;[;{;IC;" ;T;@@;0;F; [;[;%I";T;&0;'@;I"6Pubnub::Configuration::DEFAULT_RECONNECT_ATTEMPTS;F;(I",DEFAULT_RECONNECT_ATTEMPTS = 10;T;*I",DEFAULT_RECONNECT_ATTEMPTS = 10;T;I"10;T;+To;;[[@i;F;:DEFAULT_RECONNECT_INTERVAL;;;;;[;{;IC;" ;T;@M;0;F; [;[;%I";T;&0;'@;I"6Pubnub::Configuration::DEFAULT_RECONNECT_INTERVAL;F;(I",DEFAULT_RECONNECT_INTERVAL = 10;T;*I",DEFAULT_RECONNECT_INTERVAL = 10;T;I"10;T;+To;;[[@i;F;:DEFAULT_ORIGINS_POOL;;;;;[;{;IC;" ;T;@Z;0;F; [;[;%I";T;&0;'@;I"0Pubnub::Configuration::DEFAULT_ORIGINS_POOL;F;(I"?DEFAULT_ORIGINS_POOL = ['pubsub.pubnub.com'];T;*I"?DEFAULT_ORIGINS_POOL = ['pubsub.pubnub.com'];T;I"['pubsub.pubnub.com'];T;+To;;[[@i;F;:DEFAULT_PORT;;;;;[;{;IC;" ;T;@g;0;F; [;[;%I";T;&0;'@;I"(Pubnub::Configuration::DEFAULT_PORT;F;(I",DEFAULT_PORT = 80;T;*I",DEFAULT_PORT = 80;T;I"80;T;+To;;[[@i;F;:PERIODIC_TIMER_INTERVAL;;;;;[;{;IC;" ;T;@t;0;F; [;[;%I";T;&0;'@;I"3Pubnub::Configuration::PERIODIC_TIMER_INTERVAL;F;(I".PERIODIC_TIMER_INTERVAL = 0.25;T;*I".PERIODIC_TIMER_INTERVAL = 0.25;T;I" 0.25;T;+To;;[[@i;F;:DEFAULT_TTL;;;;;[;{;IC;" ;T;@;0;F; [;[;%I";T;&0;'@;I"'Pubnub::Configuration::DEFAULT_TTL;F;(I".DEFAULT_TTL = 1440;T;*I".DEFAULT_TTL = 1440;T;I" 1440;T;+T;-@;.IC;[;-@;/IC;[;-@;0IC;1{;2IC;1{;3T; IC;1{;3T;3T;4{;5[;[[@i ;T;;;;;;;[;{;IC;"4That module holds default configuration values. ;T; [;[;%I"4That module holds default configuration values.;T;&0;@;F;7o;8;9F;:i;;i;'@A;I"Pubnub::Configuration;F;+T;C;;-@t;0IC;1{;2IC;1{;3T; IC;1{;wIC;1{;s@v;t0;3T;3T;3T;4{ @J;@^;@r;@;;5[;[ [@{i7[@i [@i [@i ;T;: Client;;;;;[;{;IC;"Pubnub client Class. ;T; [;[;%I"Pubnub client Class.;T;&0;@t;F;7o;8;9F;:i6;;i6;'@A;I"Pubnub::Client;F;0;?0;@0;;6;'@;B@;C0;+To; ;IC;[ o; ; F; ; ;;;I"Pubnub::Crypto#initialize;F;[[I"cipher_key;T0;[[I"lib/pubnub/crypto.rb;Ti ;F;;J;;;[;{;IC;" ;T;@;0;F; [;[o;! ;"I" return;F;#I"a new instance of Crypto;T;0;$[I" Crypto;F;@;%I";T;&0;'@;(I"def initialize(cipher_key);T;)T;*I"def initialize(cipher_key) @alg = 'AES-256-CBC' sha256_key = Digest::SHA256.hexdigest(cipher_key) @key = sha256_key.slice(0, 32) @iv = '0123456789012345' end;T;+To; ; F; ; ;;;I"Pubnub::Crypto#encrypt;F;[[I" message;T0;[[@i;F;: encrypt;;;[;{;IC;" ;T;@;0;F; [;[;%I";T;&0;'@;(I"def encrypt(message);T;)T;*I"def encrypt(message) aes = OpenSSL::Cipher::Cipher.new(@alg) aes.encrypt aes.key = @key aes.iv = @iv json_message = message.to_json cipher = aes.update(json_message) cipher << aes.final Base64.strict_encode64(cipher) end;T;+To; ; F; ; ;;;I"Pubnub::Crypto#decrypt;F;[[I"cipher_text;T0;[[@i;F;: decrypt;;;[;{;IC;" ;T;@;0;F; [;[;%I";T;&0;'@;(I"def decrypt(cipher_text);T;)T;*I"%def decrypt(cipher_text) decode_cipher = OpenSSL::Cipher::Cipher.new(@alg).decrypt decode_cipher.key = @key decode_cipher.iv = @iv plain_text = decryption(cipher_text, decode_cipher) load_json(plain_text) Pubnub.logger.debug('Pubnub') { 'Finished decrypting' } plain_text end;T;+To; ; F; ; ;;S;I"Pubnub::Crypto#decryption;F;[[I"cipher_text;T0[I"decode_cipher;T0;[[@i.;F;:decryption;;;[;{;IC;" ;T;@;0;F; [;[;%I";T;&0;'@;(I"/def decryption(cipher_text, decode_cipher);T;)T;*I"def decryption(cipher_text, decode_cipher) undecoded_text = Base64.decode64(cipher_text) plain_text = decode_cipher.update(undecoded_text) plain_text << decode_cipher.final rescue => e Pubnub.error('Pubnub') { "DECRYPTION ERROR #{e}" } '"DECRYPTION ERROR"' end;T;+To; ; F; ; ;;S;I"Pubnub::Crypto#load_json;F;[[I" text;T0;[[@i7;F;:load_json;;;[;{;IC;" ;T;@;0;F; [;[;%I";T;&0;'@;(I"def load_json(text);T;)T;*I"cdef load_json(text) JSON.load(text) rescue JSON::ParserError JSON.load("[#{text}]")[0] end;T;+T;-@;.IC;[;-@;/IC;[;-@;0IC;1{;2IC;1{;3T; IC;1{;3T;3T;4{;5[;[[@i ;T;: Crypto;;;;;[;{;IC;"EInternal Crypto class used for message encryption and decryption ;T; [;[;%I"EInternal Crypto class used for message encryption and decryption;T;&0;@;F;7o;8;9F;:i;;i;'@A;I"Pubnub::Crypto;F;0;?0;@0;;6;'@;B@;C0;+To;;[[I"lib/pubnub/version.rb;Ti;F;;;;;;;[;{;IC;" ;T;@ ;0;F; [;[;%I";T;&0;'@A;I"Pubnub::VERSION;F;(I"VERSION = '4.0.0beta2';T;*I"VERSION = '4.0.0beta2';T;I"'4.0.0beta2';T;+To;D;IC;[ o; ;IC;[;-@* ;.IC;[;-@* ;/IC;[;-@* ;0IC;1{;2IC;1{;3T; IC;1{;3T;3T;4{;5[;[[I"lib/pubnub/message.rb;Ti ;F;:InternalMessage;;;;;[;{;IC;" ;T;@* ;0;F; [;[;%I";T;&0;'@( ;I"%Pubnub::Message::InternalMessage;F;0;?0;@0;;6;'@;B@;C0;+To; ;IC;[o; ; F; ; ;;;I" Pubnub::Message::Done#actor;F;[;[[@5 i;F;: actor;;;[;{;IC;")Returns the value of attribute actor ;T;@@ ;0;F; [;[;%I")Returns the value of attribute actor;T;&0;'@> ;(I"def actor;T;*I"def actor @actor end;T;+To; ; F; ; ;;;I"%Pubnub::Message::Done#initialize;F;[[I" actor;T0;[[@5 i;F;;J;;;[;{;IC;" ;T;@M ;0;F; [;[o;! ;"I" return;F;#I"a new instance of Done;T;0;$[I" Done;F;@M ;%I";T;&0;'@> ;(I"def initialize(actor);T;)T;*I"/def initialize(actor) @actor = actor end;T;+T;-@> ;.IC;[;-@> ;/IC;[;-@> ;0IC;1{;2IC;1{;3T; IC;1{;IC;1{;s@@ ;t0;3T;3T;3T;4{;5[;[[@5 i ;T;: Done;;;;;[;{;IC;"1Used to letting terminator to kill the actor ;T; [;[;%I"1Used to letting terminator to kill the actor;T;&0;@> ;F;7o;8;9F;:i ;;i ;'@( ;I"Pubnub::Message::Done;F;0;?0;@0;;;'@( ;B@* ;C0;+To; ;IC;[o; ; F; ; ;;;I"!Pubnub::Message::Stop#reason;F;[;[[@5 i;F;: reason;;;[;{;IC;"*Returns the value of attribute reason ;T;@v ;0;F; [;[;%I"*Returns the value of attribute reason;T;&0;'@t ;(I"def reason;T;*I"def reason @reason end;T;+To; ; F; ; ;;;I"%Pubnub::Message::Stop#initialize;F;[[I" reason;TI"nil;T;[[@5 i;F;;J;;;[;{;IC;" ;T;@ ;0;F; [;[o;! ;"I" return;F;#I"a new instance of Stop;T;0;$[I" Stop;F;@ ;%I";T;&0;'@t ;(I"!def initialize(reason = nil);T;)T;*I"8def initialize(reason = nil) @reason = reason end;T;+T;-@t ;.IC;[;-@t ;/IC;[;-@t ;0IC;1{;2IC;1{;3T; IC;1{;IC;1{;s@v ;t0;3T;3T;3T;4{;5[;[[@5 i;T;: Stop;;;;;[;{;IC;"Used to stopping events ;T; [;[;%I"Used to stopping events;T;&0;@t ;F;7o;8;9F;:i;;i;'@( ;I"Pubnub::Message::Stop;F;0;?0;@0;;;'@( ;B@* ;C0;+To; ;IC;[o; ; F; ; ;;;I"+Pubnub::Message::AddSubscription#event;F;[;[[@5 i ;F;: event;;;[;{;IC;")Returns the value of attribute event ;T;@ ;0;F; [;[;%I")Returns the value of attribute event;T;&0;'@ ;(I"def event;T;*I"def event @event end;T;+To; ; F; ; ;;;I"0Pubnub::Message::AddSubscription#initialize;F;[[I" event;T0;[[@5 i";F;;J;;;[;{;IC;" ;T;@ ;0;F; [;[o;! ;"I" return;F;#I"&a new instance of AddSubscription;T;0;$[I"AddSubscription;F;@ ;%I";T;&0;'@ ;(I"def initialize(event);T;)T;*I"/def initialize(event) @event = event end;T;+T;-@ ;.IC;[;-@ ;/IC;[;-@ ;0IC;1{;2IC;1{;3T; IC;1{;IC;1{;s@ ;t0;3T;3T;3T;4{;5[;[[@5 i;T;:AddSubscription;;;;;[;{;IC;":Used to add new subscription to currently running one ;T; [;[;%I":Used to add new subscription to currently running one;T;&0;@ ;F;7o;8;9F;:i;;i;'@( ;I"%Pubnub::Message::AddSubscription;F;0;?0;@0;;;'@( ;B@* ;C0;+To; ;IC;[o; ; F; ; ;;;I".Pubnub::Message::RemoveSubscription#event;F;[;[[@5 i);F;;;;;[;{;IC;")Returns the value of attribute event ;T;@ ;0;F; [;[;%I")Returns the value of attribute event;T;&0;'@ ;(I"def event;T;*I"def event @event end;T;+To; ; F; ; ;;;I"3Pubnub::Message::RemoveSubscription#initialize;F;[[I" event;T0;[[@5 i+;F;;J;;;[;{;IC;" ;T;@ ;0;F; [;[o;! ;"I" return;F;#I")a new instance of RemoveSubscription;T;0;$[I"RemoveSubscription;F;@ ;%I";T;&0;'@ ;(I"def initialize(event);T;)T;*I"/def initialize(event) @event = event end;T;+T;-@ ;.IC;[;-@ ;/IC;[;-@ ;0IC;1{;2IC;1{;3T; IC;1{;IC;1{;s@ ;t0;3T;3T;3T;4{;5[;[[@5 i(;T;:RemoveSubscription;;;;;[;{;IC;")Used to remove parts of subscription ;T; [;[;%I")Used to remove parts of subscription;T;&0;@ ;F;7o;8;9F;:i';;i';'@( ;I"(Pubnub::Message::RemoveSubscription;F;0;?0;@0;;;'@( ;B@* ;C0;+T;-@( ;.IC;[;-@( ;/IC;[;-@( ;0IC;1{;2IC;1{;3T; IC;1{;3T;3T;4{;5[;[[@5 i ;T;: Message;;;;;[;{;IC;",Stop class, just for internal messaging ;T; [;[;%I",Stop class, just for internal messaging;T;&0;@( ;F;7o;8;9F;:i;;i;'@A;I"Pubnub::Message;F;+To; ;IC;[6o; ; F; ; ;;;I"Pubnub::Envelope#first;F;[;[[I"lib/pubnub/envelope.rb;Ti ;F;: first;;;[;{;IC;")Returns the value of attribute first ;T;@* ;0;F; [;[;%I")Returns the value of attribute first;T;&0;'@( ;(I"def first;T;*I"def first @first end;T;+To; ; F; ; ;;;I"Pubnub::Envelope#first=;F;[[I" value;T0;[[@/ i ;F;: first=;;;[;{;IC;"Sets the attribute first ;T;@8 ;0;F; [;[o;! ;"I" param;F;#I"-the value to set the attribute first to.;T;I" value;T;$0;@8 ;%I"SSets the attribute first @param value the value to set the attribute first to.;T;&0;'@( ;(I"def first=(value);T;*I"+def first=(value) @first = value end;T;+To; ; F; ; ;;;I"Pubnub::Envelope#last;F;[;[[@/ i ;F;: last;;;[;{;IC;"(Returns the value of attribute last ;T;@K ;0;F; [;[;%I"(Returns the value of attribute last;T;&0;'@( ;(I" def last;T;*I"def last @last end;T;+To; ; F; ; ;;;I"Pubnub::Envelope#last=;F;[[I" value;T0;[[@/ i ;F;: last=;;;[;{;IC;"Sets the attribute last ;T;@X ;0;F; [;[o;! ;"I" param;F;#I",the value to set the attribute last to.;T;I" value;T;$0;@X ;%I"QSets the attribute last @param value the value to set the attribute last to.;T;&0;'@( ;(I"def last=(value);T;*I")def last=(value) @last = value end;T;+To; ; F; ; ;;;I"Pubnub::Envelope#object;F;[;[[@/ i ;F;: object;;;[;{;IC;"*Returns the value of attribute object ;T;@k ;0;F; [;[;%I"*Returns the value of attribute object;T;&0;'@( ;(I"def object;T;*I"def object @object end;T;+To; ; F; ; ;;;I"Pubnub::Envelope#object=;F;[[I" value;T0;[[@/ i ;F;: object=;;;[;{;IC;"Sets the attribute object ;T;@x ;0;F; [;[o;! ;"I" param;F;#I".the value to set the attribute object to.;T;I" value;T;$0;@x ;%I"USets the attribute object @param value the value to set the attribute object to.;T;&0;'@( ;(I"def object=(value);T;*I"-def object=(value) @object = value end;T;+To; ; F; ; ;;;I"Pubnub::Envelope#response;F;[;[[@/ i ;F;: response;;;[;{;IC;",Returns the value of attribute response ;T;@ ;0;F; [;[;%I",Returns the value of attribute response;T;&0;'@( ;(I"def response;T;*I"!def response @response end;T;+To; ; F; ; ;;;I"Pubnub::Envelope#response=;F;[[I" value;T0;[[@/ i ;F;:response=;;;[;{;IC;" Sets the attribute response ;T;@ ;0;F; [;[o;! ;"I" param;F;#I"0the value to set the attribute response to.;T;I" value;T;$0;@ ;%I"YSets the attribute response @param value the value to set the attribute response to.;T;&0;'@( ;(I"def response=(value);T;*I"1def response=(value) @response = value end;T;+To; ; F; ; ;;;I"%Pubnub::Envelope#parsed_response;F;[;[[@/ i ;F;:parsed_response;;;[;{;IC;"3Returns the value of attribute parsed_response ;T;@ ;0;F; [;[;%I"3Returns the value of attribute parsed_response;T;&0;'@( ;(I"def parsed_response;T;*I"/def parsed_response @parsed_response end;T;+To; ; F; ; ;;;I"&Pubnub::Envelope#parsed_response=;F;[[I" value;T0;[[@/ i ;F;:parsed_response=;;;[;{;IC;"'Sets the attribute parsed_response ;T;@ ;0;F; [;[o;! ;"I" param;F;#I"7the value to set the attribute parsed_response to.;T;I" value;T;$0;@ ;%I"gSets the attribute parsed_response @param value the value to set the attribute parsed_response to.;T;&0;'@( ;(I" def parsed_response=(value);T;*I"?def parsed_response=(value) @parsed_response = value end;T;+To; ; F; ; ;;;I"Pubnub::Envelope#status;F;[;[[@/ i ;F;: status;;;[;{;IC;"*Returns the value of attribute status ;T;@ ;0;F; [;[;%I"*Returns the value of attribute status;T;&0;'@( ;(I"def status;T;*I"def status @status end;T;+To; ; F; ; ;;;I"Pubnub::Envelope#status=;F;[[I" value;T0;[[@/ i ;F;: status=;;;[;{;IC;"Sets the attribute status ;T;@ ;0;F; [;[o;! ;"I" param;F;#I".the value to set the attribute status to.;T;I" value;T;$0;@ ;%I"USets the attribute status @param value the value to set the attribute status to.;T;&0;'@( ;(I"def status=(value);T;*I"-def status=(value) @status = value end;T;+To; ; F; ; ;;;I"Pubnub::Envelope#channel;F;[;[[@/ i ;F;;];;;[;{;IC;"+Returns the value of attribute channel ;T;@ ;0;F; [;[;%I"+Returns the value of attribute channel;T;&0;'@( ;(I"def channel;T;*I"def channel @channel end;T;+To; ; F; ; ;;;I"Pubnub::Envelope#channel=;F;[[I" value;T0;[[@/ i ;F;: channel=;;;[;{;IC;"Sets the attribute channel ;T;@ ;0;F; [;[o;! ;"I" param;F;#I"/the value to set the attribute channel to.;T;I" value;T;$0;@ ;%I"WSets the attribute channel @param value the value to set the attribute channel to.;T;&0;'@( ;(I"def channel=(value);T;*I"/def channel=(value) @channel = value end;T;+To; ; F; ; ;;;I"Pubnub::Envelope#message;F;[;[[@/ i ;F;;x;;;[;{;IC;"+Returns the value of attribute message ;T;@ ;0;F; [;[;%I"+Returns the value of attribute message;T;&0;'@( ;(I"def message;T;*I"def message @message end;T;+To; ; F; ; ;;;I"Pubnub::Envelope#message=;F;[[I" value;T0;[[@/ i ;F;: message=;;;[;{;IC;"Sets the attribute message ;T;@ ;0;F; [;[o;! ;"I" param;F;#I"/the value to set the attribute message to.;T;I" value;T;$0;@ ;%I"WSets the attribute message @param value the value to set the attribute message to.;T;&0;'@( ;(I"def message=(value);T;*I"/def message=(value) @message = value end;T;+To; ; F; ; ;;;I"Pubnub::Envelope#payload;F;[;[[@/ i ;F;: payload;;;[;{;IC;"+Returns the value of attribute payload ;T;@+ ;0;F; [;[;%I"+Returns the value of attribute payload;T;&0;'@( ;(I"def payload;T;*I"def payload @payload end;T;+To; ; F; ; ;;;I"Pubnub::Envelope#payload=;F;[[I" value;T0;[[@/ i ;F;: payload=;;;[;{;IC;"Sets the attribute payload ;T;@8 ;0;F; [;[o;! ;"I" param;F;#I"/the value to set the attribute payload to.;T;I" value;T;$0;@8 ;%I"WSets the attribute payload @param value the value to set the attribute payload to.;T;&0;'@( ;(I"def payload=(value);T;*I"/def payload=(value) @payload = value end;T;+To; ; F; ; ;;;I"Pubnub::Envelope#service;F;[;[[@/ i [@/ i ;F;: service;;;[;{;IC;"+Returns the value of attribute service ;T;@K ;0;F; [;[;%I"+Returns the value of attribute service;T;&0;'@( ;(I"def service;T;*I"def service @service end;T;+To; ; F; ; ;;;I"Pubnub::Envelope#service=;F;[[I" value;T0;[[@/ i [@/ i ;F;: service=;;;[;{;IC;"Sets the attribute service ;T;@Y ;0;F; [;[o;! ;"I" param;F;#I"/the value to set the attribute service to.;T;I" value;T;$0;@Y ;%I"WSets the attribute service @param value the value to set the attribute service to.;T;&0;'@( ;(I"def service=(value);T;*I"/def service=(value) @service = value end;T;+To; ; F; ; ;;;I"Pubnub::Envelope#timetoken;F;[;[[@/ i ;F;;W;;;[;{;IC;"-Returns the value of attribute timetoken ;T;@m ;0;F; [;[;%I"-Returns the value of attribute timetoken;T;&0;'@( ;(I"def timetoken;T;*I"#def timetoken @timetoken end;T;+To; ; F; ; ;;;I" Pubnub::Envelope#timetoken=;F;[[I" value;T0;[[@/ i ;F;;;;;[;{;IC;"!Sets the attribute timetoken ;T;@z ;0;F; [;[o;! ;"I" param;F;#I"1the value to set the attribute timetoken to.;T;I" value;T;$0;@z ;%I"[Sets the attribute timetoken @param value the value to set the attribute timetoken to.;T;&0;'@( ;(I"def timetoken=(value);T;*I"3def timetoken=(value) @timetoken = value end;T;+To; ; F; ; ;;;I"&Pubnub::Envelope#response_message;F;[;[[@/ i ;F;;X;;;[;{;IC;"4Returns the value of attribute response_message ;T;@ ;0;F; [;[;%I"4Returns the value of attribute response_message;T;&0;'@( ;(I"def response_message;T;*I"1def response_message @response_message end;T;+To; ; F; ; ;;;I"'Pubnub::Envelope#response_message=;F;[[I" value;T0;[[@/ i ;F;:response_message=;;;[;{;IC;"(Sets the attribute response_message ;T;@ ;0;F; [;[o;! ;"I" param;F;#I"8the value to set the attribute response_message to.;T;I" value;T;$0;@ ;%I"iSets the attribute response_message @param value the value to set the attribute response_message to.;T;&0;'@( ;(I"!def response_message=(value);T;*I"Adef response_message=(value) @response_message = value end;T;+To; ; F; ; ;;;I"Pubnub::Envelope#error;F;[;[[@/ i ;F;: error;;;[;{;IC;")Returns the value of attribute error ;T;@ ;0;F; [;[;%I")Returns the value of attribute error;T;&0;'@( ;(I"def error;T;*I"def error @error end;T;+To; ; F; ; ;;;I"Pubnub::Envelope#error=;F;[[I" value;T0;[[@/ i ;F;: error=;;;[;{;IC;"Sets the attribute error ;T;@ ;0;F; [;[o;! ;"I" param;F;#I"-the value to set the attribute error to.;T;I" value;T;$0;@ ;%I"SSets the attribute error @param value the value to set the attribute error to.;T;&0;'@( ;(I"def error=(value);T;*I"+def error=(value) @error = value end;T;+To; ; F; ; ;;;I"Pubnub::Envelope#action;F;[;[[@/ i ;F;: action;;;[;{;IC;"*Returns the value of attribute action ;T;@ ;0;F; [;[;%I"*Returns the value of attribute action;T;&0;'@( ;(I"def action;T;*I"def action @action end;T;+To; ; F; ; ;;;I"Pubnub::Envelope#action=;F;[[I" value;T0;[[@/ i ;F;: action=;;;[;{;IC;"Sets the attribute action ;T;@ ;0;F; [;[o;! ;"I" param;F;#I".the value to set the attribute action to.;T;I" value;T;$0;@ ;%I"USets the attribute action @param value the value to set the attribute action to.;T;&0;'@( ;(I"def action=(value);T;*I"-def action=(value) @action = value end;T;+To; ; F; ; ;;;I"Pubnub::Envelope#uuid;F;[;[[@/ i ;F;;;;;[;{;IC;"(Returns the value of attribute uuid ;T;@ ;0;F; [;[;%I"(Returns the value of attribute uuid;T;&0;'@( ;(I" def uuid;T;*I"def uuid @uuid end;T;+To; ; F; ; ;;;I"Pubnub::Envelope#uuid=;F;[[I" value;T0;[[@/ i ;F;;;;;[;{;IC;"Sets the attribute uuid ;T;@ ;0;F; [;[o;! ;"I" param;F;#I",the value to set the attribute uuid to.;T;I" value;T;$0;@ ;%I"QSets the attribute uuid @param value the value to set the attribute uuid to.;T;&0;'@( ;(I"def uuid=(value);T;*I")def uuid=(value) @uuid = value end;T;+To; ; F; ; ;;;I"Pubnub::Envelope#uuids;F;[;[[@/ i ;F;: uuids;;;[;{;IC;")Returns the value of attribute uuids ;T;@ ;0;F; [;[;%I")Returns the value of attribute uuids;T;&0;'@( ;(I"def uuids;T;*I"def uuids @uuids end;T;+To; ; F; ; ;;;I"Pubnub::Envelope#uuids=;F;[[I" value;T0;[[@/ i ;F;: uuids=;;;[;{;IC;"Sets the attribute uuids ;T;@ ;0;F; [;[o;! ;"I" param;F;#I"-the value to set the attribute uuids to.;T;I" value;T;$0;@ ;%I"SSets the attribute uuids @param value the value to set the attribute uuids to.;T;&0;'@( ;(I"def uuids=(value);T;*I"+def uuids=(value) @uuids = value end;T;+To; ; F; ; ;;;I"&Pubnub::Envelope#timetoken_update;F;[;[[@/ i[@/ i ;T;:timetoken_update;;;[;{;IC;"!subscribe, presence specific ;T; [;[;%I"!subscribe, presence specific;T;&0;@- ;F;7o;8;9F;:i;;i;'@( ;(I"def timetoken_update;T;*I"1def timetoken_update @timetoken_update end;T;+To; ; F; ; ;;;I"'Pubnub::Envelope#timetoken_update=;F;[[I" value;T0;[[@/ i[@/ i ;T;:timetoken_update=;;;[;{;IC;"!subscribe, presence specific ;T; [;[;%@8 ;&0;@< ;F;7@9 ;'@( ;(I"!def timetoken_update=(value);T;*I"Adef timetoken_update=(value) @timetoken_update = value end;T;+To; ; F; ; ;;;I"Pubnub::Envelope#group;F;[;[[@/ i ;F;;a;;;[;{;IC;")Returns the value of attribute group ;T;@K ;0;F; [;[;%I")Returns the value of attribute group;T;&0;'@( ;(I"def group;T;*I"def group @group end;T;+To; ; F; ; ;;;I"Pubnub::Envelope#group=;F;[[I" value;T0;[[@/ i ;F;: group=;;;[;{;IC;"Sets the attribute group ;T;@X ;0;F; [;[o;! ;"I" param;F;#I"-the value to set the attribute group to.;T;I" value;T;$0;@X ;%I"SSets the attribute group @param value the value to set the attribute group to.;T;&0;'@( ;(I"def group=(value);T;*I"+def group=(value) @group = value end;T;+To; ; F; ; ;;;I"&Pubnub::Envelope#wildcard_channel;F;[;[[@/ i ;F;:wildcard_channel;;;[;{;IC;"4Returns the value of attribute wildcard_channel ;T;@k ;0;F; [;[;%I"4Returns the value of attribute wildcard_channel;T;&0;'@( ;(I"def wildcard_channel;T;*I"1def wildcard_channel @wildcard_channel end;T;+To; ; F; ; ;;;I"'Pubnub::Envelope#wildcard_channel=;F;[[I" value;T0;[[@/ i ;F;:wildcard_channel=;;;[;{;IC;"(Sets the attribute wildcard_channel ;T;@x ;0;F; [;[o;! ;"I" param;F;#I"8the value to set the attribute wildcard_channel to.;T;I" value;T;$0;@x ;%I"iSets the attribute wildcard_channel @param value the value to set the attribute wildcard_channel to.;T;&0;'@( ;(I"!def wildcard_channel=(value);T;*I"Adef wildcard_channel=(value) @wildcard_channel = value end;T;+To; ; F; ; ;;;I"#Pubnub::Envelope#history_start;F;[;[[@/ i;T;:history_start;;;[;{;IC;"history specific ;T; [;[;%I"history specific;T;&0;@ ;F;7o;8;9F;:i;;i;'@( ;(I"def history_start;T;*I"+def history_start @history_start end;T;+To; ; F; ; ;;;I"$Pubnub::Envelope#history_start=;F;[[I" value;T0;[[@/ i;T;:history_start=;;;[;{;IC;"history specific ;T; [;[;%@ ;&0;@ ;F;7@ ;'@( ;(I"def history_start=(value);T;*I";def history_start=(value) @history_start = value end;T;+To; ; F; ; ;;;I"!Pubnub::Envelope#history_end;F;[;[[@/ i;T;:history_end;;;[;{;IC;"history specific ;T; [;[;%@ ;&0;@ ;F;7@ ;'@( ;(I"def history_end;T;*I"'def history_end @history_end end;T;+To; ; F; ; ;;;I""Pubnub::Envelope#history_end=;F;[[I" value;T0;[[@/ i;T;:history_end=;;;[;{;IC;"history specific ;T; [;[;%@ ;&0;@ ;F;7@ ;'@( ;(I"def history_end=(value);T;*I"7def history_end=(value) @history_end = value end;T;+To; ; F; ; ;;;I"Pubnub::Envelope#msg;F;[;[[@/ i;F;:msg;;;[;{;IC;"3Returns the value of attribute message aliases;T;@ ;0;F; [;[;%I"3Returns the value of attribute message aliases;T;&0;7o;8;9F;:i;;i;'@( ;(@ ;*I"def message @message end;T;+To; ; F; ; ;;;I"!Pubnub::Envelope#status_code;F;[;[[@/ i;F;:status_code;;;[;{;IC;"*Returns the value of attribute status;T;@ ;0;F; [;[;%I"+Returns the value of attribute status ;T;&0;70;'@( ;(@ ;*I"def status @status end;T;+To; ; F; ; ;;;I" Pubnub::Envelope#initialize;F;[[I"parameters;T0;[[@/ i;F;;J;;;[;{;IC;" ;T;@ ;0;F; [;[o;! ;"I" return;F;#I"a new instance of Envelope;T;0;$[I" Envelope;F;@ ;%I";T;&0;'@( ;(I"def initialize(parameters);T;)T;*I"~def initialize(parameters) parameters.each do |parameter, value| instance_variable_set("@#{parameter}", value) end end;T;+To; ; F; ; ;;;I"'Pubnub::Envelope#mark_as_timetoken;F;[;[[@/ i;F;:mark_as_timetoken;;;[;{;IC;" ;T;@ ;0;F; [;[;%I";T;&0;'@( ;(I"def mark_as_timetoken;T;)T;*I"def mark_as_timetoken if (@parsed_response[0].empty?) && (@parsed_response[1].size == 17) @timetoken_update = true else @timetoken_update = false end rescue @timetoken_update = false end;T;+To; ; F; ; ;;;I"Pubnub::Envelope#error?;F;[;[[@/ i*;F;: error?;;;[;{;IC;" ;T;@ ;0;F; [;[o;! ;"I" return;F;#I";T;0;$[I" Boolean;T;@ ;%I";T;&0;'@( ;(I"def error?;T;)T;*I"*def error? error ? true : false end;T;+To; ; F; ; ;;;I"Pubnub::Envelope#last?;F;[;[[@/ i.;F;: last?;;;[;{;IC;" ;T;@ ;0;F; [;[o;! ;"I" return;F;#I";T;0;$[I" Boolean;T;@ ;%I";T;&0;'@( ;(I"def last?;T;)T;*I"def last? last end;T;+To; ; F; ; ;;;I"Pubnub::Envelope#first?;F;[;[[@/ i2;F;: first?;;;[;{;IC;" ;T;@ ;0;F; [;[o;! ;"I" return;F;#I";T;0;$[I" Boolean;T;@ ;%I";T;&0;'@( ;(I"def first?;T;)T;*I"def first? first end;T;+T;-@( ;.IC;[;-@( ;/IC;[;-@( ;0IC;1{;2IC;1{;3T; IC;1{;IC;1{;s@* ;t@8 ;3T;IC;1{;s@K ;t@X ;3T;IC;1{;s@k ;t@x ;3T;IC;1{;s@ ;t@ ;3T;IC;1{;s@ ;t@ ;3T;IC;1{;s@ ;t@ ;3T;]IC;1{;s@ ;t@ ;3T;xIC;1{;s@ ;t@ ;3T;IC;1{;s@+ ;t@8 ;3T;IC;1{;s@K ;t@Y ;3T;WIC;1{;s@m ;t@z ;3T;XIC;1{;s@ ;t@ ;3T;IC;1{;s@ ;t@ ;3T;IC;1{;s@ ;t@ ;3T;IC;1{;s@ ;t@ ;3T;IC;1{;s@ ;t@ ;3T;IC;1{;s@- ;t@< ;3T;aIC;1{;s@K ;t@X ;3T;IC;1{;s@k ;t@x ;3T;IC;1{;s@ ;t@ ;3T;IC;1{;s@ ;t@ ;3T;3T;3T;4{@ ;x@ ;;5[;[[@/ i ;T;: Envelope;;;;;[;{;IC;"LEvery message from server is formatted into easy to use Envelope object ;T; [;[;%I"LEvery message from server is formatted into easy to use Envelope object;T;&0;@( ;F;7o;8;9F;:i;;i;'@A;I"Pubnub::Envelope;F;0;?0;@0;;6;'@;B@;C0;+To;D;IC;[o; ; F; ;2;;;I"%Pubnub::Formatter.format_channel;F;[[I" channel;T0[I"should_encode;TI" true;T;[[I"lib/pubnub/formatter.rb;Ti;T;:format_channel;;;[;{;IC;"iReturns array of encoded channels if should_encode is true, otherwise returns just array of channels ;T; [;[;%I"iReturns array of encoded channels if should_encode is true, otherwise returns just array of channels;T;&0;@Z ;F;7o;8;9F;:i ;;i ;'@X ;(I"6def format_channel(channel, should_encode = true);T;)T;*I"def format_channel(channel, should_encode = true) make_channel_array(channel).map do |chan| if should_encode encode(chan) else chan end end end;T;+To; ; F; ;2;;;I"#Pubnub::Formatter.format_group;F;[[I" group;T0[I"should_encode;TI" true;T;[[@d i;F;;o;;;[;{;IC;" ;T;@n ;0;F; [;[;%I";T;&0;'@X ;(I"2def format_group(group, should_encode = true);T;)T;*I"def format_group(group, should_encode = true) format_channel(group, should_encode).map do |g| g.gsub '%3A', ':' end end;T;+To; ; F; ;2;;;I".Pubnub::Formatter.format_presence_channel;F;[[I" presence;T0;[[@d i;F;:format_presence_channel;;;[;{;IC;" ;T;@ ;0;F; [;[;%I";T;&0;'@X ;(I"*def format_presence_channel(presence);T;)T;*I"|def format_presence_channel(presence) format_channel( make_channel_array(presence).map { |p| p + '-pnpres' } ) end;T;+To; ; F; ;2;;;I"%Pubnub::Formatter.format_message;F;[[I" message;T0[I"cipher_key;T0;[[@d i%;T;:format_message;;;[;{;IC;"-Transforms message to json and encode it ;T; [;[;%I"-Transforms message to json and encode it;T;&0;@ ;F;7o;8;9F;:i$;;i$;'@X ;(I",def format_message(message, cipher_key);T;)T;*I"def format_message(message, cipher_key) if cipher_key pc = Pubnub::Crypto.new(cipher_key) message = pc.encrypt(message) URI.escape(message.to_json) else Formatter.encode(message.to_json) end end;T;+To; ; F; ;2;;;I"&Pubnub::Formatter.classify_method;F;[[I" method;T0;[[@d i0;T;:classify_method;;;[;{;IC;"6Quite lazy way, but good enough for current usage ;T; [;[;%I"6Quite lazy way, but good enough for current usage;T;&0;@ ;F;7o;8;9F;:i/;;i/;'@X ;(I" def classify_method(method);T;)T;*I"Odef classify_method(method) method.split('_').map(&:capitalize).join end;T;+To; ; F; ;2;;;I"Pubnub::Formatter.encode;F;[[I" string;T0;[[@d i4;F;: encode;;;[;{;IC;" ;T;@ ;0;F; [;[;%I";T;&0;'@X ;(I"def encode(string);T;)T;*I"Tdef encode(string) URI.encode_www_form_component(string).gsub('+', '%20') end;T;+To; ; F; ;2;;;I")Pubnub::Formatter.make_channel_array;F;[[I" channel;T0;[[@d i8;F;:make_channel_array;;;[;{;IC;" ;T;@ ;0;F; [;[;%I";T;&0;'@X ;(I"$def make_channel_array(channel);T;)T;*I"def make_channel_array(channel) case channel.class.to_s when 'String' then channel.to_s.split(',') when 'Symbol' then channel.to_s.split(',') when 'Array' then channel.map(&:to_s) when 'NilClass' then [] else fail Pubnub::ArgumentError.new( message: 'Channel has to be String, Symbol or Array' ), 'Channel has to be String, Symbol or Array' end end;T;+To; ; F; ;2;;;I"!Pubnub::Formatter.parse_json;F;[[I" string;T0;[[@d iE;T;:parse_json;;;[;{;IC;"Parses string to JSON ;T; [;[;%I"Parses string to JSON;T;&0;@ ;F;7o;8;9F;:iD;;iD;'@X ;(I"def parse_json(string);T;)T;*I"ldef parse_json(string) [JSON.parse(string), nil] rescue JSON::ParserError => error [nil, error] end;T;+To; ; F; ;2;;;I"0Pubnub::Formatter.params_hash_to_url_params;F;[[I" hash;T0;[[@d iL;T;:params_hash_to_url_params;;;[;{;IC;""Formats hash to params string ;T; [;[;%I""Formats hash to params string;T;&0;@ ;F;7o;8;9F;:iK;;iK;'@X ;(I"(def params_hash_to_url_params(hash);T;)T;*I"def params_hash_to_url_params(hash) params = '' hash.each do |key, value| params << "#{key}=#{value}&" end params.chop! if params[-1] == '&' end;T;+To; ; F; ;2;;;I"'Pubnub::Formatter.channels_for_url;F;[[I" channels;T0;[[@d iU;T;:channels_for_url;;;[;{;IC;"GReturns string with all channels separated by comma or single coma ;T; [;[;%I"GReturns string with all channels separated by comma or single coma;T;&0;@ ;F;7o;8;9F;:iT;;iT;'@X ;(I"#def channels_for_url(channels);T;)T;*I"rdef channels_for_url(channels) channel = channels.join(',') channel = ',' if channel.empty? channel end;T;+To; ; F; ;2;;;I""Pubnub::Formatter.valid_json?;F;[[I" string;T0;[[@d i\;T;:valid_json?;;;[;{;IC;"&Checks if json in string is valid ;T; [;[o;! ;"I" return;F;#I";T;0;$[I" Boolean;T;@ ;%I"&Checks if json in string is valid;T;&0;@ ;F;7o;8;9F;:i[;;i[;'@X ;(I"def valid_json?(string);T;)T;*I"edef valid_json?(string) JSON.parse(string) ? true : false rescue JSON::ParserError false end;T;+T;-@X ;.IC;[;-@X ;/IC;[;-@X ;0IC;1{;2IC;1{;3T; IC;1{;3T;3T;4{;5[;[[@d i ;T;:Formatter;;;;;[;{;IC;"}Bunch of useful methods that are used in many parts of Pubnub and and can be usable for any app that uses Pubnub library ;T; [;[;%I"}Bunch of useful methods that are used in many parts of Pubnub and and can be usable for any app that uses Pubnub library;T;&0;@X ;F;7o;8;9F;:i;;i ;'@A;I"Pubnub::Formatter;F;+To; ;IC;[ o; ; F; ; ;;;I"Pubnub::Time#initialize;F;[[I" options;T0[I"app;T0;[[I"lib/pubnub/events/time.rb;Ti ;F;;J;;;[;{;IC;" ;T;@';0;F; [;[o;! ;"I" return;F;#I"a new instance of Time;T;0;$[I" Time;F;@';%I";T;&0;'@%;(I"!def initialize(options, app);T;)T;*I">def initialize(options, app) @event = :time super end;T;+To; ; F; ; ;;S;I"Pubnub::Time#path;F;[;[[@0i;F;;V;;;[;{;IC;" ;T;@>;0;F; [;[;%I";T;&0;'@%;(I" def path;T;)T;*I"def path '/time/0' end;T;+To; ; F; ; ;;S;I"Pubnub::Time#timetoken;F;[[I"parsed_response;T0;[[@0i;F;;W;;;[;{;IC;" ;T;@K;0;F; [;[;%I";T;&0;'@%;(I"#def timetoken(parsed_response);T;)T;*I"Ldef timetoken(parsed_response) parsed_response.first rescue nil end;T;+To; ; F; ; ;;S;I""Pubnub::Time#format_envelopes;F;[[I" response;T0;[[@0i;F;;N;;;[;{;IC;" ;T;@Z;0;F; [;[;%I";T;&0;'@%;(I"#def format_envelopes(response);T;)T;*I"def format_envelopes(response) parsed_response, error = Formatter.parse_json(response.body) error = response if parsed_response && response.code != '200' envelopes = if error [error_envelope(parsed_response, error)] else [valid_envelope(parsed_response)] end add_common_data_to_envelopes(envelopes, response) end;T;+To; ; F; ; ;;S;I" Pubnub::Time#valid_envelope;F;[[I"parsed_response;T0;[[@0i);F;;O;;;[;{;IC;" ;T;@i;0;F; [;[;%I";T;&0;'@%;(I"(def valid_envelope(parsed_response);T;)T;*I"def valid_envelope(parsed_response) Envelope.new( parsed_response: parsed_response, message: timetoken(parsed_response), response_message: timetoken(parsed_response), timetoken: timetoken(parsed_response) ) end;T;+To; ; F; ; ;;S;I" Pubnub::Time#error_envelope;F;[[I"parsed_response;T0[I" error;T0;[[@0i2;F;;P;;;[;{;IC;" ;T;@x;0;F; [;[;%I";T;&0;'@%;(I"/def error_envelope(parsed_response, error);T;)T;*I"def error_envelope(parsed_response, error) ErrorEnvelope.new( error: error, response_message: parsed_response, timetoken: timetoken(parsed_response) ) end;T;+T;-@%;.IC;[;-@%;/IC;[o;= ;>0;?0;@0;;;'@%;B0;C;;-@%;0IC;1{;2IC;1{;3T; IC;1{;3T;3T;4{;5[;[[@0i ;T;: Time;;;;;[;{;IC;"Holds time functionality ;T; [;[;%I"Holds time functionality;T;&0;@%;F;7o;8;9F;:i;;i;'@A;I"Pubnub::Time;F;0;?0;@0;;R;'@A;B@;C;2;+T@o; ;IC;[o; ; F; ; ;;;I"Pubnub::Audit#initialize;F;[[I" options;T0[I"app;T0;[[I"lib/pubnub/events/audit.rb;Ti ;F;;J;;;[;{;IC;" ;T;@;0;F; [;[o;! ;"I" return;F;#I"a new instance of Audit;T;0;$[I" Audit;F;@;%I";T;&0;'@;(I"!def initialize(options, app);T;)T;*I"?def initialize(options, app) @event = :audit super end;T;+To; ; F; ; ;;S;I"Pubnub::Audit#parameters;F;[[I"signature;TI" false;T;[[@i;F;;L;;;[;{;IC;" ;T;@;0;F; [;[;%I";T;&0;'@;(I"&def parameters(signature = false);T;)T;*I"^def parameters(signature = false) { timestamp: @timestamp }.merge(super(signature)) end;T;+To; ; F; ; ;;S;I"Pubnub::Audit#path;F;[;[[@i;F;;V;;;[;{;IC;" ;T;@;0;F; [;[;%I";T;&0;'@;(I" def path;T;)T;*I"ndef path '/' + [ 'v1', 'auth', 'audit', 'sub-key', @subscribe_key ].join('/') end;T;+T;-@;.IC;[;-@;/IC;[o;= ;>0;?0;@0;;;'@;B0;C;;-@;0IC;1{;2IC;1{;3T; IC;1{;3T;3T;4{;5[;[[@i ;T;: Audit;;;;;[;{;IC;"!Holds here_now functionality ;T; [;[;%I"!Holds here_now functionality;T;&0;@;F;7o;8;9F;:i;;i;'@A;I"Pubnub::Audit;F;0;?0;@0;;Q;'@A;B@;C0;+To; ;IC;[ o; ; F; ; ;;S;I"Pubnub::State#initialize;F;[[I" options;T0[I"app;T0;[[I"lib/pubnub/events/state.rb;Ti [@i;F;;J;;;[;{;IC;" ;T;@;0;F; [;[o;! ;"I" return;F;#I"a new instance of State;T;0;$[I" State;F;@;%I";T;&0;'@;(I"!def initialize(options, app);T;)T;*I"?def initialize(options, app) @event = :state super end;T;+To; ; F; ; ;;S;I"Pubnub::State#parameters;F;[;[[@i;F;;L;;;[;{;IC;" ;T;@;0;F; [;[;%I";T;&0;'@;(I"def parameters;T;)T;*I"def parameters parameters = super parameters.merge!( 'channel-group' => @group.join(',') ) unless @group.blank? parameters end;T;+To; ; F; ; ;;S;I"Pubnub::State#path;F;[;[[@i#;F;;V;;;[;{;IC;" ;T;@ ;0;F; [;[;%I";T;&0;'@;(I" def path;T;)T;*I"def path '/' + [ 'v2', 'presence', 'sub_key', @subscribe_key, 'channel', Formatter.channels_for_url(@channel), 'uuid', @uuid_looking_for ].join('/') end;T;+To; ; F; ; ;;S;I"#Pubnub::State#format_envelopes;F;[[I" response;T0;[[@i0;F;;N;;;[;{;IC;" ;T;@;0;F; [;[;%I";T;&0;'@;(I"#def format_envelopes(response);T;)T;*I"def format_envelopes(response) parsed_response, error = Formatter.parse_json(response.body) error = response if parsed_response && response.code != '200' envelopes = if error [error_envelope(parsed_response, error)] else [valid_envelope(parsed_response)] end add_common_data_to_envelopes(envelopes, response) end;T;+To; ; F; ; ;;S;I"!Pubnub::State#valid_envelope;F;[[I"parsed_response;T0;[[@i>;F;;O;;;[;{;IC;" ;T;@(;0;F; [;[;%I";T;&0;'@;(I"(def valid_envelope(parsed_response);T;)T;*I"`def valid_envelope(parsed_response) Envelope.new( parsed_response: parsed_response, channel: parsed_response['channel'], payload: parsed_response['payload'], service: parsed_response['service'], message: parsed_response['message'], uuid: parsed_response['uuid'], status: parsed_response['status'] ) end;T;+To; ; F; ; ;;S;I"!Pubnub::State#error_envelope;F;[[I"parsed_response;T0[I" error;T0;[[@iJ;F;;P;;;[;{;IC;" ;T;@7;0;F; [;[;%I";T;&0;'@;(I"/def error_envelope(parsed_response, error);T;)T;*I"def error_envelope(parsed_response, error) ErrorEnvelope.new( error: error, response_message: response_message(parsed_response) ) end;T;+T;-@;.IC;[;-@;/IC;[o;= ;>0;?0;@0;;;'@;B0;C;;-@;0IC;1{;2IC;1{;3T; IC;1{;3T;3T;4{;5[;[[@i ;T;: State;;;;;[;{;IC;"Holds state functionality ;T; [;[;%I"Holds state functionality;T;&0;@;F;7o;8;9F;:i;;i;'@A;I"Pubnub::State;F;0;?0;@0;;R;'@A;B@;C0;+To; ;IC;[ o; ; F; ; ;;;I"Pubnub::Leave#initialize;F;[[I" options;T0[I"app;T0;[[I"lib/pubnub/events/leave.rb;Ti ;F;;J;;;[;{;IC;" ;T;@];0;F; [;[o;! ;"I" return;F;#I"a new instance of Leave;T;0;$[I" Leave;F;@];%I";T;&0;'@[;(I"!def initialize(options, app);T;)T;*I"?def initialize(options, app) @event = :leave super end;T;+To; ; F; ; ;;;I"Pubnub::Leave#fire;F;[;[[@fi;F;;d;;;[;{;IC;" ;T;@t;0;F; [;[;%I";T;&0;'@[;(I" def fire;T;)T;*I"Fdef fire remove_subscription super restart_subscription end;T;+To; ; F; ; ;;S;I"&Pubnub::Leave#remove_subscription;F;[;[[@fi;F;:remove_subscription;;;[;{;IC;" ;T;@;0;F; [;[;%I";T;&0;'@[;(I"def remove_subscription;T;)T;*I"def remove_subscription @app.env[:subscription_pool][@origin].remove(Celluloid::Actor.current) rescue NoMethodError => _error Pubnub.logger.error('Pubnub::Leave') do 'Tried to remove from non-existing subscription' end end;T;+To; ; F; ; ;;S;I"'Pubnub::Leave#restart_subscription;F;[;[[@fi!;F;;;;;[;{;IC;" ;T;@;0;F; [;[;%I";T;&0;'@[;(I"def restart_subscription;T;)T;*I"def restart_subscription @app.env[:subscription_pool][@origin].async.fire rescue NoMethodError => _error Pubnub.logger.error('Pubnub::Leave') do 'Tried to restart non-existing subscription' end end;T;+To; ; F; ; ;;S;I"Pubnub::Leave#path;F;[;[[@fi);F;;V;;;[;{;IC;" ;T;@;0;F; [;[;%I";T;&0;'@[;(I" def path;T;)T;*I"def path '/' + [ 'v2', 'presence', 'sub-key', @subscribe_key, 'channel', Formatter.channels_for_url(@channel), 'leave' ].join('/') end;T;+To; ; F; ; ;;S;I"#Pubnub::Leave#format_envelopes;F;[[I" response;T0;[[@fi5;F;;N;;;[;{;IC;" ;T;@;0;F; [;[;%I";T;&0;'@[;(I"#def format_envelopes(response);T;)T;*I"def format_envelopes(response) parsed_response, error = Formatter.parse_json(response.body) error = response if parsed_response && response.code != '200' envelopes = if error [error_envelope(parsed_response, error)] else [valid_envelope(parsed_response)] end add_common_data_to_envelopes(envelopes, response) end;T;+To; ; F; ; ;;S;I"!Pubnub::Leave#valid_envelope;F;[[I"parsed_response;T0;[[@fiC;F;;O;;;[;{;IC;" ;T;@;0;F; [;[;%I";T;&0;'@[;(I"(def valid_envelope(parsed_response);T;)T;*I"\def valid_envelope(parsed_response) Envelope.new( parsed_response: parsed_response, action: parsed_response['action'], message: parsed_response['message'], uuid: parsed_response['uuid'], status: parsed_response['status'], service: parsed_response['service'] ) end;T;+To; ; F; ; ;;S;I"!Pubnub::Leave#error_envelope;F;[[I"parsed_response;T0[I" error;T0;[[@fiN;F;;P;;;[;{;IC;" ;T;@;0;F; [;[;%I";T;&0;'@[;(I"/def error_envelope(parsed_response, error);T;)T;*I"def error_envelope(parsed_response, error) ErrorEnvelope.new( error: error, response_message: response_message(parsed_response), channel: @channel.first, timetoken: timetoken(parsed_response) ) end;T;+T;-@[;.IC;[;-@[;/IC;[o;= ;>0;?0;@0;;;'@[;B0;C;;-@[;0IC;1{;2IC;1{;3T; IC;1{;3T;3T;4{;5[;[[@fi ;T;: Leave;;;;;[;{;IC;"Holds leave functionality ;T; [;[;%I"Holds leave functionality;T;&0;@[;F;7o;8;9F;:i;;i;'@A;I"Pubnub::Leave;F;0;?0;@0;;R;'@A;B@;C0;+To; ;IC;[o; ; F; ; ;;;I"Pubnub::Grant#initialize;F;[[I" options;T0[I"app;T0;[[I"lib/pubnub/events/grant.rb;Ti ;F;;J;;;[;{;IC;" ;T;@;0;F; [;[o;! ;"I" return;F;#I"a new instance of Grant;T;0;$[I" Grant;F;@;%I";T;&0;'@;(I"!def initialize(options, app);T;)T;*I"mdef initialize(options, app) @event = :grant super @ttl ||= Pubnub::Configuration::DEFAULT_TTL end;T;+To; ; F; ; ;;S;I"Pubnub::Grant#parameters;F;[[I"signature;TI" false;T;[[@i;F;;L;;;[;{;IC;" ;T;@;0;F; [;[;%I";T;&0;'@;(I"&def parameters(signature = false);T;)T;*I"edef 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? { timestamp: @timestamp, w: write, r: read, m: manage, ttl: @ttl }.delete_if { |_k, v| v.nil? }.merge(super(signature)) end;T;+To; ; F; ; ;;S;I"Pubnub::Grant#path;F;[;[[@i ;F;;V;;;[;{;IC;" ;T;@;0;F; [;[;%I";T;&0;'@;(I" def path;T;)T;*I"ndef path '/' + [ 'v1', 'auth', 'grant', 'sub-key', @subscribe_key ].join('/') end;T;+T;-@;.IC;[;-@;/IC;[o;= ;>0;?0;@0;;;'@;B0;C;;-@;0IC;1{;2IC;1{;3T; IC;1{;3T;3T;4{;5[;[[@i ;T;: Grant;;;;;[;{;IC;"Holds grant functionality ;T; [;[;%I"Holds grant functionality;T;&0;@;F;7o;8;9F;:i;;i;'@A;I"Pubnub::Grant;F;0;?0;@0;;Q;'@A;B@;C0;+To; ;IC;[o; ; F; ; ;;;I"Pubnub::Revoke#initialize;F;[[I" options;T0[I"app;T0;[[I" lib/pubnub/events/revoke.rb;Ti ;F;;J;;;[;{;IC;" ;T;@5;0;F; [;[o;! ;"I" return;F;#I"a new instance of Revoke;T;0;$[I" Revoke;F;@5;%I";T;&0;'@3;(I"!def initialize(options, app);T;)T;*I"mdef initialize(options, app) @event = :grant super @ttl ||= Pubnub::Configuration::DEFAULT_TTL end;T;+To; ; F; ; ;;S;I"Pubnub::Revoke#parameters;F;[[I"signature;TI" false;T;[[@>i;F;;L;;;[;{;IC;" ;T;@L;0;F; [;[;%I";T;&0;'@3;(I"&def parameters(signature = false);T;)T;*I"ddef parameters(signature = false) write = [0, '0', false].include?(@write) ? 1 : 0 read = [0, '0', false].include?(@read) ? 1 : 0 manage = [0, '0', false].include?(@manage) ? 1 : 0 unless @group.blank? { timestamp: @timestamp, w: write, r: read, m: manage, ttl: @ttl }.delete_if { |_k, v| v.nil? }.merge(super(signature)) end;T;+To; ; F; ; ;;S;I"Pubnub::Revoke#path;F;[;[[@>i ;F;;V;;;[;{;IC;" ;T;@\;0;F; [;[;%I";T;&0;'@3;(I" def path;T;)T;*I"ndef path '/' + [ 'v1', 'auth', 'grant', 'sub-key', @subscribe_key ].join('/') end;T;+T;-@3;.IC;[;-@3;/IC;[o;= ;>0;?0;@0;;;'@3;B0;C;;-@3;0IC;1{;2IC;1{;3T; IC;1{;3T;3T;4{;5[;[[@>i ;T;: Revoke;;;;;[;{;IC;"Holds revoke functionality ;T; [;[;%I"Holds revoke functionality;T;&0;@3;F;7o;8;9F;:i;;i;'@A;I"Pubnub::Revoke;F;0;?0;@0;;Q;'@A;B@;C0;+T@o; ;IC;[o; ; F; ; ;;;I"$Pubnub::OriginManager#last_ping;F;[;[[I"!lib/pubnub/origin_manager.rb;Ti ;F;:last_ping;;;[;{;IC;"-Returns the value of attribute last_ping ;T;@~;0;F; [;[;%I"-Returns the value of attribute last_ping;T;&0;'@|;(I"def last_ping;T;*I"#def last_ping @last_ping end;T;+To; ; F; ; ;;;I"#Pubnub::OriginManager#failback;F;[;[[@i ;F;: failback;;;[;{;IC;",Returns the value of attribute failback ;T;@;0;F; [;[;%I",Returns the value of attribute failback;T;&0;'@|;(I"def failback;T;*I"!def failback @failback end;T;+To; ; F; ; ;;;I"%Pubnub::OriginManager#initialize;F;[[I"app;T0;[[@i ;F;;J;;;[;{;IC;" ;T;@;0;F; [;[o;! ;"I" return;F;#I"$a new instance of OriginManager;T;0;$[I"OriginManager;F;@;%I";T;&0;'@|;(I"def initialize(app);T;)T;*I")def initialize(app) @app = app end;T;+To; ; F; ; ;;;I" Pubnub::OriginManager#start;F;[;[[@i;F;: start;;;[;{;IC;" ;T;@;0;F; [;[;%I";T;&0;'@|;(I"def start;T;)T;*I"def start origin_to_test = current_origin return false unless test_origin(origin_to_test) bring_down(origin_to_test) @app.reset_subscription end;T;+To; ; F; ; ;;;I")Pubnub::OriginManager#current_origin;F;[;[[@i;F;;;;;[;{;IC;" ;T;@;0;F; [;[;%I";T;&0;'@|;(I"def current_origin;T;)T;*I"1def current_origin @app.current_origin end;T;+To; ; F; ; ;;;I")Pubnub::OriginManager#online_origins;F;[;[[@i;F;:online_origins;;;[;{;IC;" ;T;@;0;F; [;[;%I";T;&0;'@|;(I"def online_origins;T;)T;*I"1def online_origins @app.online_origins end;T;+To; ; F; ; ;;;I"*Pubnub::OriginManager#offline_origins;F;[;[[@i!;F;:offline_origins;;;[;{;IC;" ;T;@;0;F; [;[;%I";T;&0;'@|;(I"def offline_origins;T;)T;*I"3def offline_origins @app.offline_origins end;T;+To; ; F; ; ;;S;I"&Pubnub::OriginManager#test_origin;F;[[I" origin;T0;[[@i';F;:test_origin;;;[;{;IC;" ;T;@;0;F; [;[;%I";T;&0;'@|;(I"def test_origin(origin);T;)T;*I"}def test_origin(origin) if alive_and_valid?(URI.parse(@http + origin + '/time/0')) true else false end end;T;+To; ; F; ; ;;S;I"+Pubnub::OriginManager#alive_and_valid?;F;[[I"uri;T0;[[@i/;F;:alive_and_valid?;;;[;{;IC;" ;T;@;0;F; [;[o;! ;"I" return;F;#I";T;0;$[I" Boolean;T;@;%I";T;&0;'@|;(I"def alive_and_valid?(uri);T;)T;*I"def alive_and_valid?(uri) response_valid? get_ping_response(uri) rescue Errno::ECONNREFUSED false rescue => e Pubnub.logger.error('Pubnub::OriginManager') do "#{e.inspect} #{e.backtrace}" end false end;T;+To; ; F; ; ;;S;I"*Pubnub::OriginManager#response_valid?;F;[[I" response;T0;[[@i:;F;:response_valid?;;;[;{;IC;" ;T;@;0;F; [;[o;! ;"I" return;F;#I";T;0;$[I" Boolean;T;@;%I";T;&0;'@|;(I""def response_valid?(response);T;)T;*I"def response_valid?(response) if response.is_a?(Net::HTTPSuccess) && Formatter.valid_json?(response.body) true else false end end;T;+To; ; F; ; ;;S;I",Pubnub::OriginManager#get_ping_response;F;[[I"uri;T0;[[@iC;F;:get_ping_response;;;[;{;IC;" ;T;@;0;F; [;[;%I";T;&0;'@|;(I"def get_ping_response(uri);T;)T;*I"def get_ping_response(uri) Net::HTTP.start(uri.host, uri.port) do |http| request = Net::HTTP::Get.new uri http.read_timeout = @timeout http.request request end end;T;+To; ; F; ; ;;S;I"Pubnub::OriginManager#ping;F;[[I" _origin;T0;[[@iK;F;: ping;;;[;{;IC;" ;T;@';0;F; [;[;%I";T;&0;'@|;(I"def ping(_origin);T;)T;*I"4def ping(_origin) alive_and_valid?(@http) end;T;+To; ; F; ; ;;S;I"%Pubnub::OriginManager#bring_down;F;[[I" _origin;T0;[[@iO;F;:bring_down;;;[;{;IC;" ;T;@6;0;F; [;[;%I";T;&0;'@|;(I"def bring_down(_origin);T;)T;*I" def bring_down(_origin) end;T;+To; ; F; ; ;;S;I"#Pubnub::OriginManager#bring_up;F;[[I" _origin;T0;[[@iR;F;: bring_up;;;[;{;IC;" ;T;@E;0;F; [;[;%I";T;&0;'@|;(I"def bring_up(_origin);T;)T;*I"def bring_up(_origin) end;T;+T;-@|;.IC;[;-@|;/IC;[;-@|;0IC;1{;2IC;1{;3T; IC;1{;IC;1{;s@~;t0;3T;IC;1{;s@;t0;3T;3T;3T;4{;5[;[[@i ;T;:OriginManager;;;;;[;{;IC;"`OriginManager changes origin in client to online one and keeps monitoring available origins ;T; [;[;%I"`OriginManager changes origin in client to online one and keeps monitoring available origins;T;&0;@|;F;7o;8;9F;:i;;i ;'@A;I"Pubnub::OriginManager;F;0;?0;@0;;6;'@;B@;C0;+To; ;IC;[o; ; F; ; ;;;I"%Pubnub::ErrorEnvelope#initialize;F;[[I" _env;TI"{};T;[[I"!lib/pubnub/error_envelope.rb;Ti ;F;;J;;;[;{;IC;" ;T;@j;0;F; [;[o;! ;"I" return;F;#I"$a new instance of ErrorEnvelope;T;0;$[I"ErrorEnvelope;F;@j;%I";T;&0;'@h;(I"def initialize(_env = {});T;)T;*I">def initialize(_env = {}) super set_error_message end;T;+To; ; F; ; ;;;I"!Pubnub::ErrorEnvelope#error?;F;[;[[@ri;F;;;;;[;{;IC;" ;T;@;0;F; [;[o;! ;"I" return;F;#I";T;0;$[I" Boolean;T;@;%I";T;&0;'@h;(I"def error?;T;)T;*I"def error? true end;T;+To; ; F; ; ;;S;I",Pubnub::ErrorEnvelope#set_error_message;F;[;[[@ri;F;:set_error_message;;;[;{;IC;" ;T;@;0;F; [;[;%I";T;&0;'@h;(I"def set_error_message;T;)T;*I"def set_error_message @message = case @error.class.to_s when 'JSON::ParserError' '[0,"Invalid JSON in response."]' when 'Net::HTTPInternalServerError' '[0,"Non 2xx server response."]' when 'Net::HTTPBadRequest' '[0,"Non 2xx server response."]' else '[0,"Unknown error"]' end end;T;+T;-@h;.IC;[;-@h;/IC;[;-@h;0IC;1{;2IC;1{;3T; IC;1{;3T;3T;4{;5[;[[@ri ;T;:ErrorEnvelope;;;;;[;{;IC;"Every error message from server is formatted into easy to use ErrorEnvelope object, it behaves like normal Envelope, only difference is that it returns true on error? method ;T; [;[;%I"Every error message from server is formatted into easy to use ErrorEnvelope object, it behaves like normal Envelope, only difference is that it returns true on error? method;T;&0;@h;F;7o;8;9F;:i;;i ;'@A;I"Pubnub::ErrorEnvelope;F;0;?0;@0;;;'@A;B@( ;C0;+To; ;IC;[ o; ; F; ; ;;;I"Pubnub::Publish#initialize;F;[[I" options;T0[I"app;T0;[[I"!lib/pubnub/events/publish.rb;Ti ;F;;J;;;[;{;IC;" ;T;@;0;F; [;[o;! ;"I" return;F;#I"a new instance of Publish;T;0;$[I" Publish;F;@;%I";T;&0;'@;(I"!def initialize(options, app);T;)T;*I"Adef initialize(options, app) @event = :publish super end;T;+To; ; F; ; ;;S;I"Pubnub::Publish#path;F;[;[[@i;F;;V;;;[;{;IC;" ;T;@;0;F; [;[;%I";T;&0;'@;(I" def path;T;)T;*I"def path '/' + [ 'publish', @publish_key, @subscribe_key, (@auth_key.blank? ? '0' : @secret_key), @channel, '0', Formatter.format_message(@message, @cipher_key) ].join('/') end;T;+To; ; F; ; ;;S;I"Pubnub::Publish#timetoken;F;[[I"parsed_response;T0;[[@i;F;;W;;;[;{;IC;" ;T;@;0;F; [;[;%I";T;&0;'@;(I"#def timetoken(parsed_response);T;)T;*I"Idef timetoken(parsed_response) parsed_response[2] rescue nil end;T;+To; ; F; ; ;;S;I"%Pubnub::Publish#response_message;F;[[I"parsed_response;T0;[[@i%;F;;X;;;[;{;IC;" ;T;@;0;F; [;[;%I";T;&0;'@;(I"*def response_message(parsed_response);T;)T;*I"Pdef response_message(parsed_response) parsed_response[1] rescue nil end;T;+To; ; F; ; ;;S;I"%Pubnub::Publish#format_envelopes;F;[[I" response;T0;[[@i+;F;;N;;;[;{;IC;" ;T;@;0;F; [;[;%I";T;&0;'@;(I"#def format_envelopes(response);T;)T;*I"def format_envelopes(response) parsed_response, error = Formatter.parse_json(response.body) error = response if parsed_response && response.code != '200' envelopes = if error [error_envelope(parsed_response, error)] else [valid_envelope(parsed_response)] end add_common_data_to_envelopes(envelopes, response) end;T;+To; ; F; ; ;;S;I"#Pubnub::Publish#valid_envelope;F;[[I"parsed_response;T0;[[@i9;F;;O;;;[;{;IC;" ;T;@;0;F; [;[;%I";T;&0;'@;(I"(def valid_envelope(parsed_response);T;)T;*I"def valid_envelope(parsed_response) Envelope.new( parsed_response: parsed_response, message: @message, channel: @channel.first, response_message: response_message(parsed_response), timetoken: timetoken(parsed_response) ) end;T;+To; ; F; ; ;;S;I"#Pubnub::Publish#error_envelope;F;[[I"parsed_response;T0[I" error;T0;[[@iC;F;;P;;;[;{;IC;" ;T;@;0;F; [;[;%I";T;&0;'@;(I"/def error_envelope(parsed_response, error);T;)T;*I"def error_envelope(parsed_response, error) ErrorEnvelope.new( error: error, response_message: response_message(parsed_response), channel: @channel.first, timetoken: timetoken(parsed_response) ) end;T;+T;-@;.IC;[;-@;/IC;[o;= ;>0;?0;@0;;;'@;B0;C;;-@;0IC;1{;2IC;1{;3T; IC;1{;3T;3T;4{;5[;[[@i ;T;: Publish;;;;;[;{;IC;" Holds publish functionality ;T; [;[;%I" Holds publish functionality;T;&0;@;F;7o;8;9F;:i;;i;'@A;I"Pubnub::Publish;F;0;?0;@0;;R;'@A;B@;C0;+To; ;IC;[ o; ; F; ; ;;;I"Pubnub::History#initialize;F;[[I" options;T0[I"app;T0;[[I"!lib/pubnub/events/history.rb;Ti ;F;;J;;;[;{;IC;" ;T;@9;0;F; [;[o;! ;"I" return;F;#I"a new instance of History;T;0;$[I" History;F;@9;%I";T;&0;'@7;(I"!def initialize(options, app);T;)T;*I"Adef initialize(options, app) @event = :history super end;T;+To; ; F; ; ;;S;I"Pubnub::History#timetoken;F;[[I"parsed_response;T0;[[@Bi;F;;W;;;[;{;IC;" ;T;@P;0;F; [;[;%I";T;&0;'@7;(I"#def timetoken(parsed_response);T;)T;*I"Idef timetoken(parsed_response) parsed_response[2] rescue nil end;T;+To; ; F; ; ;;S;I"%Pubnub::History#response_message;F;[[I"parsed_response;T0;[[@Bi;F;;X;;;[;{;IC;" ;T;@_;0;F; [;[;%I";T;&0;'@7;(I"*def response_message(parsed_response);T;)T;*I"Pdef response_message(parsed_response) parsed_response[1] rescue nil end;T;+To; ; F; ; ;;S;I"Pubnub::History#path;F;[;[[@Bi;F;;V;;;[;{;IC;" ;T;@n;0;F; [;[;%I";T;&0;'@7;(I" def path;T;)T;*I"|def path '/' + [ 'v2', 'history', 'sub-key', @subscribe_key, 'channel', @channel ].join('/') end;T;+To; ; F; ; ;;S;I"Pubnub::History#parameters;F;[;[[@Bi*;F;;L;;;[;{;IC;" ;T;@{;0;F; [;[;%I";T;&0;'@7;(I"def parameters;T;)T;*I"def parameters params = super params.merge!(start: @start) if @start params.merge!(end: @end) if @end params.merge!(count: @count) if @count params.merge!(reverse: 'true') if @reverse params end;T;+To; ; F; ; ;;S;I"%Pubnub::History#format_envelopes;F;[[I" response;T0;[[@Bi3;F;;N;;;[;{;IC;" ;T;@;0;F; [;[;%I";T;&0;'@7;(I"#def format_envelopes(response);T;)T;*I"~def format_envelopes(response) parsed_response, error = Formatter.parse_json(response.body) error = response if parsed_response && response.code != '200' envelopes = if error [error_envelope(parsed_response, error)] else valid_envelopes(parsed_response) end add_common_data_to_envelopes(envelopes, response) end;T;+To; ; F; ; ;;S;I"$Pubnub::History#valid_envelopes;F;[[I"parsed_response;T0;[[@BiA;F;:valid_envelopes;;;[;{;IC;" ;T;@;0;F; [;[;%I";T;&0;'@7;(I")def valid_envelopes(parsed_response);T;)T;*I"def valid_envelopes(parsed_response) parsed_response.first.map do |message| Envelope.new(parsed_response: parsed_response, message: message, channel: @channel.first, response_message: response_message(parsed_response), timetoken: timetoken(parsed_response), history_start: parsed_response[1], history_end: parsed_response[2]) end end;T;+To; ; F; ; ;;S;I"#Pubnub::History#error_envelope;F;[[I"parsed_response;T0[I" error;T0;[[@BiM;F;;P;;;[;{;IC;" ;T;@;0;F; [;[;%I";T;&0;'@7;(I"/def error_envelope(parsed_response, error);T;)T;*I"def error_envelope(parsed_response, error) ErrorEnvelope.new( error: error, response_message: response_message(parsed_response), channel: @channel.first, timetoken: timetoken(parsed_response) ) end;T;+T;-@7;.IC;[;-@7;/IC;[o;= ;>0;?0;@0;;;'@7;B0;C;;-@7;0IC;1{;2IC;1{;3T; IC;1{;3T;3T;4{;5[;[[@Bi ;T;: History;;;;;[;{;IC;" Holds history functionality ;T; [;[;%I" Holds history functionality;T;&0;@7;F;7o;8;9F;:i;;i;'@A;I"Pubnub::History;F;0;?0;@0;;R;'@A;B@;C0;+To; ;IC;[o; ; F; ; ;;;I"!Pubnub::SubscribeEvent#heart;F;[;[[I""lib/pubnub/subscribe_event.rb;Ti;F;: heart;;;[;{;IC;")Returns the value of attribute heart ;T;@;0;F; [;[;%I")Returns the value of attribute heart;T;&0;'@;(I"def heart;T;*I"def heart @heart end;T;+To; ; F; ; ;;;I"&Pubnub::SubscribeEvent#initialize;F;[[I" options;T0[I"app;T0;[[@i;F;;J;;;[;{;IC;" ;T;@;0;F; [;[o;! ;"I" return;F;#I"%a new instance of SubscribeEvent;T;0;$[I"SubscribeEvent;F;@;%I";T;&0;'@;(I"!def initialize(options, app);T;)T;*I"def initialize(options, app) super @heartbeat = @app.env[:heartbeat] setup_cb_pools @wildcard_channel = @channel.select{ |e| e.index('.*') } || [] @channel -= @wildcard_channel @channel.each do |channel| @c_cb_pool[channel] = @callback @e_cb_pool[channel] = @error_callback end @group.each do |group| @g_cb_pool[group] = @callback end @wildcard_channel.each do |wc| @wc_cb_pool[wc] = @callback @wc_cb_pool[wc + '-pnpres'] = @presence_callback end end;T;+To; ; F; ; ;;;I" Pubnub::SubscribeEvent#fire;F;[;[[@i(;F;;d;;;[;{;IC;" ;T;@;0;F; [;[;%I";T;&0;'@;(I" def fire;T;)T;*I"def fire return false if @finalized Pubnub.logger.debug('Pubnub') { "Fired event #{self.class}" } fire_heartbeat if @heartbeat && !@http_sync && !@heart Pubnub.logger.info "\n\nWHATEVER\n\n" message = send_request Pubnub.logger.debug('Pubnub') { 'Fire before fire_callback' } envelopes = fire_callbacks(handle(message)) finalize_event(envelopes) async.fire unless @http_sync envelopes end;T;+To; ; F; ; ;;;I"%Pubnub::SubscribeEvent#leave_all;F;[;[[@i=;F;:leave_all;;;[;{;IC;" ;T;@;0;F; [;[;%I";T;&0;'@;(I"def leave_all;T;)T;*I"def leave_all Pubnub.logger.debug('Pubnub') { 'Leaving all subscriptions' } @channel.each do |channel| @app.leave(channel: channel, skip_restart: true, http_sync: true) end finish end;T;+To; ; F; ; ;;S;I"(Pubnub::SubscribeEvent#send_request;F;[;[[@iG;F;:send_request;;;[;{;IC;" ;T;@ ;0;F; [;[;%I";T;&0;'@;(I"def send_request;T;)T;*I"def send_request Pubnub.logger.debug('Pubnub') { '#send_request start' } request_dispatcher.send_request(Celluloid::Actor.current) end;T;+To; ; F; ; ;;S;I"*Pubnub::SubscribeEvent#setup_cb_pools;F;[;[[@iM;F;:setup_cb_pools;;;[;{;IC;" ;T;@;0;F; [;[;%I";T;&0;'@;(I"def setup_cb_pools;T;)T;*I"def setup_cb_pools @g_cb_pool ||= {} # group @c_cb_pool ||= {} # channel @wc_cb_pool ||= {} # wildcard @e_cb_pool ||= {} # error end;T;+To; ; F; ; ;;S;I".Pubnub::SubscribeEvent#request_dispatcher;F;[;[[@iT;F;;T;;;[;{;IC;" ;T;@$;0;F; [;[;%I";T;&0;'@;(I"def request_dispatcher;T;)T;*I"def request_dispatcher Pubnub.logger.debug('Pubnub') { '#request_dispatcher' } @app.request_dispatcher(@origin, :subscribe_event, @http_sync) end;T;+To; ; F; ; ;;S;I"*Pubnub::SubscribeEvent#fire_callbacks;F;[[I"envelopes;T0;[[@iZ;F;;j;;;[;{;IC;" ;T;@1;0;F; [;[;%I";T;&0;'@;(I""def fire_callbacks(envelopes);T;)T;*I"def fire_callbacks(envelopes) if @http_sync super else Pubnub.logger.debug('Pubnub') { "Firing callbacks for #{self.class}" } fire_async_callbacks(envelopes) end envelopes end;T;+To; ; F; ; ;;S;I"0Pubnub::SubscribeEvent#fire_async_callbacks;F;[[I"envelopes;T0;[[@id;F;:fire_async_callbacks;;;[;{;IC;" ;T;@@;0;F; [;[;%I";T;&0;'@;(I"(def fire_async_callbacks(envelopes);T;)T;*I"def fire_async_callbacks(envelopes) envelopes.each do |envelope| if !envelope.error && !envelope.message.nil? fire_success_callback envelope elsif envelope.error fire_error_callback envelope end end end;T;+To; ; F; ; ;;S;I"1Pubnub::SubscribeEvent#fire_success_callback;F;[[I" envelope;T0;[[@in;F;:fire_success_callback;;;[;{;IC;" ;T;@O;0;F; [;[;%I";T;&0;'@;(I"(def fire_success_callback(envelope);T;)T;*I"%def fire_success_callback(envelope) if envelope.group && @g_cb_pool[envelope.group] secure_call @g_cb_pool[envelope.group], envelope elsif envelope.wildcard_channel && envelope.channel.index('-pnpres') && @wc_cb_pool[envelope.wildcard_channel + '-pnpres'] secure_call @wc_cb_pool[envelope.wildcard_channel + '-pnpres'], envelope elsif envelope.wildcard_channel && !envelope.channel.index('-pnpres') secure_call @wc_cb_pool[envelope.wildcard_channel], envelope else secure_call @c_cb_pool[envelope.channel], envelope end end;T;+To; ; F; ; ;;S;I"/Pubnub::SubscribeEvent#fire_error_callback;F;[[I" envelope;T0;[[@iz;F;:fire_error_callback;;;[;{;IC;" ;T;@^;0;F; [;[;%I";T;&0;'@;(I"&def fire_error_callback(envelope);T;)T;*I"def fire_error_callback(envelope) if @e_cb_pool[envelope.channel] secure_call @e_cb_pool[envelope.channel], envelope else secure_call @app.env[:error_callback], envelope end end;T;+To; ; F; ; ;;S;I"*Pubnub::SubscribeEvent#finalize_event;F;[[I"envelopes;T0;[[@i};F;;U;;;[;{;IC;" ;T;@m;0;F; [;[;%I";T;&0;'@;(I""def finalize_event(envelopes);T;)T;*I"def finalize_event(envelopes) Pubnub.logger.debug('Pubnub') { '#finalize_event' } @app.timetoken = envelopes.first.timetoken end;T;+To; ; F; ; ;;S;I" Pubnub::SubscribeEvent#path;F;[;[[@i;F;;V;;;[;{;IC;" ;T;@|;0;F; [;[;%I";T;&0;'@;(I" def path;T;)T;*I"def path '/' + [ 'subscribe', @subscribe_key, Pubnub::Formatter.channels_for_url(@channel + @wildcard_channel), 0, (@app.env[:timetoken] || 0) ].join('/').gsub(/\?/, '%3F') end;T;+To; ; F; ; ;;S;I"&Pubnub::SubscribeEvent#parameters;F;[;[[@i;F;;L;;;[;{;IC;" ;T;@;0;F; [;[;%I";T;&0;'@;(I"def parameters;T;)T;*I"{def parameters params = super params.merge!('channel-group' => @group.join(',')) unless @group.empty? params end;T;+To;D;IC;[ o; ; F; ; ;;;I".Pubnub::SubscribeEvent::Adding#add_groups;F;[[I" event;T0;[[I")lib/pubnub/subscribe_event/adding.rb;Ti ;F;:add_groups;;;[;{;IC;" ;T;@;0;F; [;[;%I";T;&0;'@;(I"def add_groups(event);T;)T;*I"def add_groups(event) event.group.each do |group| add_group group add_g_cb group, event.callback, event.error_callback end end;T;+To; ; F; ; ;;;I"0Pubnub::SubscribeEvent::Adding#add_channels;F;[[I" event;T0;[[@i;F;:add_channels;;;[;{;IC;" ;T;@;0;F; [;[;%I";T;&0;'@;(I"def add_channels(event);T;)T;*I"def add_channels(event) event.channel.each do |channel| add_channel channel add_c_cb channel, event.callback, event.error_callback end end;T;+To; ; F; ; ;;;I"'Pubnub::SubscribeEvent::Adding#add;F;[[I" event;T0;[[@i;F;:add;;;[;{;IC;" ;T;@;0;F; [;[;%I";T;&0;'@;(I"def add(event);T;)T;*I"def add(event) Pubnub.logger.debug('Pubnub') { "#{self.class}#add" } @app.kill_request_dispatcher(@origin, :subscribe_event) add_channels(event) add_groups(event) restart_heartbeat if @heart end;T;+To; ; F; ; ;;S;I",Pubnub::SubscribeEvent::Adding#add_g_cb;F;[[I" group;T0[I"cb;T0[I" _e_cb;T0;[[@i%;F;: add_g_cb;;;[;{;IC;" ;T;@;0;F; [;[;%I";T;&0;'@;(I"#def add_g_cb(group, cb, _e_cb);T;)T;*I"@def add_g_cb(group, cb, _e_cb) @g_cb_pool[group] = cb end;T;+To; ; F; ; ;;S;I",Pubnub::SubscribeEvent::Adding#add_c_cb;F;[[I" channel;T0[I"cb;T0[I" e_cb;T0;[[@i);F;: add_c_cb;;;[;{;IC;" ;T;@;0;F; [;[;%I";T;&0;'@;(I"$def add_c_cb(channel, cb, e_cb);T;)T;*I"`def add_c_cb(channel, cb, e_cb) @c_cb_pool[channel] = cb @e_cb_pool[channel] = e_cb end;T;+To; ; F; ; ;;S;I"-Pubnub::SubscribeEvent::Adding#add_group;F;[[I" group;T0;[[@i.;F;:add_group;;;[;{;IC;" ;T;@;0;F; [;[;%I";T;&0;'@;(I"def add_group(group);T;)T;*I"/def add_group(group) @group << group end;T;+To; ; F; ; ;;S;I"/Pubnub::SubscribeEvent::Adding#add_channel;F;[[I" channel;T0;[[@i2;F;:add_channel;;;[;{;IC;" ;T;@;0;F; [;[;%I";T;&0;'@;(I"def add_channel(channel);T;)T;*I"7def add_channel(channel) @channel << channel end;T;+T;-@;.IC;[;-@;/IC;[;-@;0IC;1{;2IC;1{;3T; IC;1{;3T;3T;4{;5[;[[@i ;T;: Adding;;;;;[;{;IC;"8Holds methods connected with channels and cg adding ;T; [;[;%I"8Holds methods connected with channels and cg adding;T;&0;@;F;7o;8;9F;:i ;;i ;'@;I"#Pubnub::SubscribeEvent::Adding;F;+To;D;IC;[o; ; F; ; ;;;I"3Pubnub::SubscribeEvent::Removing#remove_groups;F;[[I" event;T0;[[I"+lib/pubnub/subscribe_event/removing.rb;Ti ;F;:remove_groups;;;[;{;IC;" ;T;@;0;F; [;[;%I";T;&0;'@;(I"def remove_groups(event);T;)T;*I"rdef remove_groups(event) event.group.each do |group| remove_group group remove_g_cb group end end;T;+To; ; F; ; ;;;I"5Pubnub::SubscribeEvent::Removing#remove_channels;F;[[I" event;T0;[[@$i;F;:remove_channels;;;[;{;IC;" ;T;@-;0;F; [;[;%I";T;&0;'@;(I"def remove_channels(event);T;)T;*I"~def remove_channels(event) event.channel.each do |channel| remove_channel channel remove_c_cb channel end end;T;+To; ; F; ; ;;;I",Pubnub::SubscribeEvent::Removing#remove;F;[[I" event;T0;[[@$i;F;: remove;;;[;{;IC;" ;T;@<;0;F; [;[;%I";T;&0;'@;(I"def remove(event);T;)T;*I"def remove(event) Pubnub.logger.debug('Pubnub') { "#{self.class}#remove" } kill_requester remove_channels(event) remove_groups(event) if @channel.empty? && @group.empty? finish else restart_heartbeat if @heart end end;T;+To; ; F; ; ;;S;I"4Pubnub::SubscribeEvent::Removing#kill_requester;F;[;[[@$i);F;:kill_requester;;;[;{;IC;" ;T;@K;0;F; [;[;%I";T;&0;'@;(I"def kill_requester;T;)T;*I"Udef kill_requester @app.kill_request_dispatcher(@origin, :subscribe_event) end;T;+To; ; F; ; ;;S;I"1Pubnub::SubscribeEvent::Removing#remove_g_cb;F;[[I" group;T0;[[@$i-;F;:remove_g_cb;;;[;{;IC;" ;T;@X;0;F; [;[;%I";T;&0;'@;(I"def remove_g_cb(group);T;)T;*I"9def remove_g_cb(group) @g_cb_pool[group] = nil end;T;+To; ; F; ; ;;S;I"1Pubnub::SubscribeEvent::Removing#remove_c_cb;F;[[I" channel;T0;[[@$i1;F;:remove_c_cb;;;[;{;IC;" ;T;@g;0;F; [;[;%I";T;&0;'@;(I"def remove_c_cb(channel);T;)T;*I"Ydef remove_c_cb(channel) @c_cb_pool[channel] = nil @e_cb_pool[channel] = nil end;T;+To; ; F; ; ;;S;I"2Pubnub::SubscribeEvent::Removing#remove_group;F;[[I" group;T0;[[@$i6;F;:remove_group;;;[;{;IC;" ;T;@v;0;F; [;[;%I";T;&0;'@;(I"def remove_group(group);T;)T;*I"7def remove_group(group) @group.delete(group) end;T;+To; ; F; ; ;;S;I"4Pubnub::SubscribeEvent::Removing#remove_channel;F;[[I" channel;T0;[[@$i:;F;:remove_channel;;;[;{;IC;" ;T;@;0;F; [;[;%I";T;&0;'@;(I" def remove_channel(channel);T;)T;*I"?def remove_channel(channel) @channel.delete(channel) end;T;+To; ; F; ; ;;S;I",Pubnub::SubscribeEvent::Removing#finish;F;[;[[@$i>;F;: finish;;;[;{;IC;" ;T;@;0;F; [;[;%I";T;&0;'@;(I"def finish;T;)T;*I"def finish Pubnub.logger.debug('Pubnub') { 'Stopping subscription' } stop_heartbeat if @heart kill_requester @finalized = true @app.env[:subscription_pool][@origin] = nil terminate end;T;+T;-@;.IC;[;-@;/IC;[;-@;0IC;1{;2IC;1{;3T; IC;1{;3T;3T;4{;5[;[[@$i ;T;: Removing;;;;;[;{;IC;"9Holds methods connected with channels and cg removal ;T; [;[;%I"9Holds methods connected with channels and cg removal;T;&0;@;F;7o;8;9F;:i ;;i ;'@;I"%Pubnub::SubscribeEvent::Removing;F;+To;D;IC;[o; ; F; ; ;;S;I"5Pubnub::SubscribeEvent::Formatter#error_envelope;F;[[I"parsed_response;T0[I" error;T0;[[I",lib/pubnub/subscribe_event/formatter.rb;Ti ;F;;P;;;[;{;IC;" ;T;@;0;F; [;[;%I";T;&0;'@;(I"/def error_envelope(parsed_response, error);T;)T;*I"def error_envelope(parsed_response, error) ErrorEnvelope.new( error: error, response_message: parsed_response, message: parsed_response, parsed_response: parsed_response, channel: @channel.first ) end;T;+To; ; F; ; ;;S;I"5Pubnub::SubscribeEvent::Formatter#valid_envelope;F;[ [I"parsed_response;T0[I"msg;TI"nil;T[I" channel;TI"nil;T[I" group;TI"nil;T;[[@i;F;;O;;;[;{;IC;" ;T;@;0;F; [;[;%I";T;&0;'@;(I"Odef valid_envelope(parsed_response, msg = nil, channel = nil, group = nil);T;)T;*I"def valid_envelope(parsed_response, msg = nil, channel = nil, group = nil) if group && group.index('.*') wildcard_channel = group group = nil end Envelope.new( parsed_response: parsed_response, message: msg, channel: channel, group: group, wildcard_channel: wildcard_channel, response_message: parsed_response, timetoken: timetoken(parsed_response) ) end;T;+To; ; F; ; ;;S;I"HPubnub::SubscribeEvent::Formatter#envelope_from_channel_group_or_wc;F;[[I"parsed_response;T0[I"i;T0;[[@i(;F;:&envelope_from_channel_group_or_wc;;;[;{;IC;" ;T;@;0;F; [;[;%I";T;&0;'@;(I">def envelope_from_channel_group_or_wc(parsed_response, i);T;)T;*I"def envelope_from_channel_group_or_wc(parsed_response, i) valid_envelope(parsed_response, parsed_response[0][i], parsed_response[3].split(',')[i], parsed_response[2].split(',')[i]) end;T;+To; ; F; ; ;;S;I"APubnub::SubscribeEvent::Formatter#format_channel_group_or_wc;F;[[I"parsed_response;T0;[[@i/;F;:format_channel_group_or_wc;;;[;{;IC;" ;T;@;0;F; [;[;%I";T;&0;'@;(I"4def format_channel_group_or_wc(parsed_response);T;)T;*I"def format_channel_group_or_wc(parsed_response) Pubnub.logger.debug('Pubnub') { 'Formatting channel group' } envelopes = [] if parsed_response.first.empty? # timetoken update envelopes << format_timetoken(parsed_response) else parsed_response.first.size.times do |i| envelopes << envelope_from_channel_group_or_wc(parsed_response, i) end end envelopes end;T;+To; ; F; ; ;;S;I"=Pubnub::SubscribeEvent::Formatter#envelope_from_multiple;F;[[I"parsed_response;T0[I"i;T0;[[@i<;F;:envelope_from_multiple;;;[;{;IC;" ;T;@;0;F; [;[;%I";T;&0;'@;(I"3def envelope_from_multiple(parsed_response, i);T;)T;*I"def envelope_from_multiple(parsed_response, i) valid_envelope(parsed_response, parsed_response.first[i], parsed_response.last.split(',')[i]) end;T;+To; ; F; ; ;;S;I"?Pubnub::SubscribeEvent::Formatter#format_multiple_channels;F;[[I"parsed_response;T0;[[@iB;F;:format_multiple_channels;;;[;{;IC;" ;T;@;0;F; [;[;%I";T;&0;'@;(I"2def format_multiple_channels(parsed_response);T;)T;*I"[def format_multiple_channels(parsed_response) Pubnub.logger.debug('Pubnub') { 'Formatting multiple channel' } if parsed_response.last == '' [format_timetoken(parsed_response)] else envelopes = [] parsed_response.first.size.times do |i| envelopes << envelope_from_multiple(parsed_response, i) end envelopes end end;T;+To; ; F; ; ;;S;I"0;?0;@0;;;'@A;B@X ;C;o;= ;>0;?0;@0;;:;'@;B@z;C;o;= ;>0;?0;@0;;/;'@;B@;C;o;= ;>0;?0;@0;;%;'@;B@;C;;-@;0IC;1{;2IC;1{;3T; IC;1{;IC;1{;s@;t0;3T;3T;3T;4{;5[;[ [@i [@i[@$i[@i[@i;T;:SubscribeEvent;;;;;[;{;IC;"ESubscribeEvent module holds infrastructure for subscribe events. ;T; [;[;%I"ESubscribeEvent module holds infrastructure for subscribe events.;T;&0;@;F;7o;8;9F;:i;;i;'@A;I"Pubnub::SubscribeEvent;F;0;?0;@0;;Y;'@A;B@;C0;+To; ;IC;[o; ; F; ; ;;;I" Pubnub::Presence#initialize;F;[[I" options;T0[I"app;T0;[[I""lib/pubnub/events/presence.rb;Ti ;F;;J;;;[;{;IC;" ;T;@;0;F; [;[o;! ;"I" return;F;#I"a new instance of Presence;T;0;$[I" Presence;F;@;%I";T;&0;'@;(I"!def initialize(options, app);T;)T;*I"Bdef initialize(options, app) @event = :presence super end;T;+To; ; F; ; ;;;I"%Pubnub::Presence#format_channels;F;[;[[@i;F;;i;;;[;{;IC;" ;T;@;0;F; [;[;%I";T;&0;'@;(I"def format_channels;T;)T;*I"def format_channels @channel = Formatter.format_channel(@channel || @channels) @channel = @channel.map { |c| c + '-pnpres' } end;T;+T;-@;.IC;[;-@;/IC;[o;= ;>0;?0;@0;;;'@;B0;C;;-@;0IC;1{;2IC;1{;3T; IC;1{;3T;3T;4{;5[;[[@i ;T;: Presence;;;;;[;{;IC;"cHolds presence functionality, beware, most of presence functionality is held by SubscribeEvent ;T; [;[;%I"cHolds presence functionality, beware, most of presence functionality is held by SubscribeEvent;T;&0;@;F;7o;8;9F;:i;;i ;'@A;I"Pubnub::Presence;F;0;?0;@0;;;;'@A;B@;C0;+To; ;IC;[ o; ; F; ; ;;;I"Pubnub::HereNow#initialize;F;[[I" options;T0[I"app;T0;[[I""lib/pubnub/events/here_now.rb;Ti ;F;;J;;;[;{;IC;" ;T;@ ;0;F; [;[o;! ;"I" return;F;#I"a new instance of HereNow;T;0;$[I" HereNow;F;@ ;%I";T;&0;'@ ;(I"!def initialize(options, app);T;)T;*I"Cdef initialize(options, app) @event = :here_now super end;T;+To; ; F; ; ;;S;I"Pubnub::HereNow#path;F;[;[[@i;F;;V;;;[;{;IC;" ;T;@";0;F; [;[;%I";T;&0;'@ ;(I" def path;T;)T;*I"Zdef path if @channel.first.blank? global_path else channel_path end end;T;+To; ; F; ; ;;S;I"!Pubnub::HereNow#channel_path;F;[;[[@i;F;:channel_path;;;[;{;IC;" ;T;@/;0;F; [;[;%I";T;&0;'@ ;(I"def channel_path;T;)T;*I"def channel_path '/' + [ 'v2', 'presence', 'sub-key', @subscribe_key, 'channel', @channel ].join('/') end;T;+To; ; F; ; ;;S;I" Pubnub::HereNow#global_path;F;[;[[@i&;F;:global_path;;;[;{;IC;" ;T;@<;0;F; [;[;%I";T;&0;'@ ;(I"def global_path;T;)T;*I"def global_path '/' + [ 'v2', 'presence', 'sub-key', @subscribe_key, ('channel' unless @group.blank?), (',' unless @group.blank?) ].delete_if {|e| e.nil? }.join('/') end;T;+To; ; F; ; ;;S;I"Pubnub::HereNow#parameters;F;[;[[@i1;F;;L;;;[;{;IC;" ;T;@I;0;F; [;[;%I";T;&0;'@ ;(I"def parameters;T;)T;*I"def parameters parameters = super parameters.merge!( 'channel-group' => @group.join(',') ) unless @group.blank? parameters end;T;+To; ; F; ; ;;S;I"%Pubnub::HereNow#format_envelopes;F;[[I" response;T0;[[@i9;F;;N;;;[;{;IC;" ;T;@V;0;F; [;[;%I";T;&0;'@ ;(I"#def format_envelopes(response);T;)T;*I"def format_envelopes(response) parsed_response, error = Formatter.parse_json(response.body) error = response if parsed_response && response.code != '200' envelopes = if error [error_envelope(parsed_response, error)] else [valid_envelope(parsed_response)] end add_common_data_to_envelopes(envelopes, response) end;T;+To; ; F; ; ;;S;I"#Pubnub::HereNow#valid_envelope;F;[[I"parsed_response;T0;[[@iG;F;;O;;;[;{;IC;" ;T;@e;0;F; [;[;%I";T;&0;'@ ;(I"(def valid_envelope(parsed_response);T;)T;*I"^def valid_envelope(parsed_response) Envelope.new( parsed_response: parsed_response, payload: parsed_response['payload'], service: parsed_response['service'], message: parsed_response['message'], status: parsed_response['status'], uuids: parsed_response['uuids'] ) end;T;+To; ; F; ; ;;S;I"#Pubnub::HereNow#error_envelope;F;[[I"parsed_response;T0[I" error;T0;[[@iR;F;;P;;;[;{;IC;" ;T;@t;0;F; [;[;%I";T;&0;'@ ;(I"/def error_envelope(parsed_response, error);T;)T;*I"def error_envelope(parsed_response, error) ErrorEnvelope.new( error: error, response_message: response_message(parsed_response), channel: @channel.first, timetoken: timetoken(parsed_response) ) end;T;+T;-@ ;.IC;[;-@ ;/IC;[o;= ;>0;?0;@0;;;'@ ;B0;C;;-@ ;0IC;1{;2IC;1{;3T; IC;1{;3T;3T;4{;5[;[[@i ;T;: HereNow;;;;;[;{;IC;"!Holds here_now functionality ;T; [;[;%I"!Holds here_now functionality;T;&0;@ ;F;7o;8;9F;:i;;i;'@A;I"Pubnub::HereNow;F;0;?0;@0;;R;'@A;B@;C0;+To; ;IC;[ o; ; F; ; ;;;I"!Pubnub::Heartbeat#initialize;F;[[I" options;T0[I"app;T0;[[I"#lib/pubnub/events/heartbeat.rb;Ti ;F;;J;;;[;{;IC;" ;T;@;0;F; [;[o;! ;"I" return;F;#I" a new instance of Heartbeat;T;0;$[I"Heartbeat;F;@;%I";T;&0;'@;(I"!def initialize(options, app);T;)T;*I"Cdef initialize(options, app) @event = :heartbeat super end;T;+To; ; F; ; ;;S;I"Pubnub::Heartbeat#path;F;[;[[@i;F;;V;;;[;{;IC;" ;T;@;0;F; [;[;%I";T;&0;'@;(I" def path;T;)T;*I"def path '/' + [ 'v2', 'presence', 'sub-key', @subscribe_key, 'channel', Formatter.channels_for_url(@channel), 'heartbeat' ].join('/') end;T;+To; ; F; ; ;;S;I"!Pubnub::Heartbeat#parameters;F;[;[[@i ;F;;L;;;[;{;IC;" ;T;@;0;F; [;[;%I";T;&0;'@;(I"def parameters;T;)T;*I"6def parameters parameters = super if @app.env[:state] && @app.env[:state][@origin] parameters.merge!(state: encode_state(@app.env[:state][@origin])) end parameters.merge!(heartbeat: @heartbeat) parameters.merge!( 'channel-group' => @group.join(',') ) unless @group.blank? parameters end;T;+To; ; F; ; ;;S;I"#Pubnub::Heartbeat#encode_state;F;[[I" state;T0;[[@i,;F;;r;;;[;{;IC;" ;T;@;0;F; [;[;%I";T;&0;'@;(I"def encode_state(state);T;)T;*I"`def encode_state(state) URI.encode_www_form_component(state.to_json).gsub('+', '%20') end;T;+To; ; F; ; ;;S;I"'Pubnub::Heartbeat#format_envelopes;F;[[I" response;T0;[[@i0;F;;N;;;[;{;IC;" ;T;@;0;F; [;[;%I";T;&0;'@;(I"#def format_envelopes(response);T;)T;*I"def format_envelopes(response) parsed_response, error = Formatter.parse_json(response.body) error = response if parsed_response && response.code != '200' envelopes = if error [error_envelope(parsed_response, error)] else [valid_envelope(parsed_response)] end add_common_data_to_envelopes(envelopes, response) end;T;+To; ; F; ; ;;S;I"%Pubnub::Heartbeat#valid_envelope;F;[[I"parsed_response;T0;[[@i>;F;;O;;;[;{;IC;" ;T;@;0;F; [;[;%I";T;&0;'@;(I"(def valid_envelope(parsed_response);T;)T;*I"def valid_envelope(parsed_response) Envelope.new( message: parsed_response, response_message: parsed_response ) end;T;+To; ; F; ; ;;S;I"%Pubnub::Heartbeat#error_envelope;F;[[I"parsed_response;T0[I" error;T0;[[@iE;F;;P;;;[;{;IC;" ;T;@;0;F; [;[;%I";T;&0;'@;(I"/def error_envelope(parsed_response, error);T;)T;*I"def error_envelope(parsed_response, error) ErrorEnvelope.new( error: error, response_message: response_message(parsed_response), channel: @channel.first, timetoken: timetoken(parsed_response) ) end;T;+T;-@;.IC;[;-@;/IC;[o;= ;>0;?I"Pubnub::Formatter;T;@@;;;'@A;B@X ;C;o;= ;>0;?0;@0;;;'@;B0;C;;-@;0IC;1{;2IC;1{;3T; IC;1{;3T;3T;4{;5[;[[@i ;T;;:;;;;;[;{;IC;""Holds heartbeat functionality ;T; [;[;%I""Holds heartbeat functionality;T;&0;@;F;7o;8;9F;:i;;i;'@A;I"Pubnub::Heartbeat;F;0;?0;@0;;R;'@A;B@;C0;+To; ;IC;[ o; ; F; ; ;;;I" Pubnub::WhereNow#initialize;F;[[I" options;T0[I"app;T0;[[I"#lib/pubnub/events/where_now.rb;Ti ;F;;J;;;[;{;IC;" ;T;@ ;0;F; [;[o;! ;"I" return;F;#I"a new instance of WhereNow;T;0;$[I" WhereNow;F;@ ;%I";T;&0;'@;(I"!def initialize(options, app);T;)T;*I"def initialize(options, app) super @uuid_looking_for = options[:uuid] || options['uuid'] @uuid = app.uuid @event = :where_now end;T;+To; ; F; ; ;;S;I"Pubnub::WhereNow#path;F;[;[[@)i;F;;V;;;[;{;IC;" ;T;@7;0;F; [;[;%I";T;&0;'@;(I" def path;T;)T;*I"def path '/' + [ 'v2', 'presence', 'sub-key', @subscribe_key, 'uuid', @uuid_looking_for ].join('/') end;T;+To; ; F; ; ;;S;I"&Pubnub::WhereNow#format_envelopes;F;[[I" response;T0;[[@)i ;F;;N;;;[;{;IC;" ;T;@D;0;F; [;[;%I";T;&0;'@;(I"#def format_envelopes(response);T;)T;*I"def format_envelopes(response) parsed_response, error = Formatter.parse_json(response.body) error = response if parsed_response && response.code != '200' envelopes = if error [error_envelope(parsed_response, error)] else [valid_envelope(parsed_response)] end add_common_data_to_envelopes(envelopes, response) end;T;+To; ; F; ; ;;S;I"$Pubnub::WhereNow#valid_envelope;F;[[I"parsed_response;T0;[[@)i.;F;;O;;;[;{;IC;" ;T;@S;0;F; [;[;%I";T;&0;'@;(I"(def valid_envelope(parsed_response);T;)T;*I"-def valid_envelope(parsed_response) Envelope.new( parsed_response: parsed_response, payload: parsed_response['payload'], service: parsed_response['service'], message: parsed_response['message'], status: parsed_response['status'] ) end;T;+To; ; F; ; ;;S;I"$Pubnub::WhereNow#error_envelope;F;[[I"parsed_response;T0[I" error;T0;[[@)i8;F;;P;;;[;{;IC;" ;T;@b;0;F; [;[;%I";T;&0;'@;(I"/def error_envelope(parsed_response, error);T;)T;*I"def error_envelope(parsed_response, error) ErrorEnvelope.new( error: error, response_message: response_message(parsed_response), channel: @channel.first, timetoken: timetoken(parsed_response) ) end;T;+T;-@;.IC;[;-@;/IC;[o;= ;>0;?0;@0;;;'@;B0;C;;-@;0IC;1{;2IC;1{;3T; IC;1{;3T;3T;4{;5[;[[@)i ;T;: WhereNow;;;;;[;{;IC;""Holds where_now functionality ;T; [;[;%I""Holds where_now functionality;T;&0;@;F;7o;8;9F;:i;;i;'@A;I"Pubnub::WhereNow;F;0;?0;@0;;R;'@A;B@;C0;+To; ;IC;[o; ; F; ; ;;;I"!Pubnub::Subscribe#initialize;F;[[I" options;T0[I"app;T0;[[I"#lib/pubnub/events/subscribe.rb;Ti ;F;;J;;;[;{;IC;" ;T;@;0;F; [;[o;! ;"I" return;F;#I" a new instance of Subscribe;T;0;$[I"Subscribe;F;@;%I";T;&0;'@;(I"!def initialize(options, app);T;)T;*I"Cdef initialize(options, app) @event = :subscribe super end;T;+T;-@;.IC;[;-@;/IC;[o;= ;>0;?0;@0;;;'@;B0;C;;-@;0IC;1{;2IC;1{;3T; IC;1{;3T;3T;4{;5[;[[@i ;T;:Subscribe;;;;;[;{;IC;"eHolds subscribe functionality, beware, most of subscribe functionality is held by SubscribeEvent ;T; [;[;%I"eHolds subscribe functionality, beware, most of subscribe functionality is held by SubscribeEvent;T;&0;@;F;7o;8;9F;:i;;i ;'@A;I"Pubnub::Subscribe;F;0;?0;@0;;;;'@A;B@;C0;+To;D;IC;[ o;D;IC;[o; ; F; ;2;;;I"(Pubnub::Validator::Client.validate!;F;[[I"parameters;T0;[[I"$lib/pubnub/validators/client.rb;Ti;F;;;;;[;{;IC;" ;T;@;0;F; [;[;%I";T;&0;'@;(I"def validate!(parameters);T;)T;*I"def validate!(parameters) validate_origin parameters[:origins_pool], true validate_subscribe_key parameters[:subscribe_key], true validate_publish_key parameters[:publish_key] end;T;+T;-@;.IC;[o;= ;>0;?0;@0;:CommonValidator;'@;Bo;D;IC;[o; ; F; ; ;;;I"7Pubnub::Validator::CommonValidator#validate_origin;F;[[I" origin;T0[I" required;TI" false;T;[[I".lib/pubnub/validators/common_validator.rb;Ti ;T;:validate_origin;;;[;{;IC;"Validates given origin ;T; [;[;%I"Validates given origin;T;&0;@;F;7o;8;9F;:i ;;i ;'@;(I"2def validate_origin(origin, required = false);T;)T;*I"Rdef validate_origin(origin, required = false) fail( InitializationError.new, 'Missing required :origins_pool parameter.' ) if !origin && required fail( InitializationError.new, 'origins_pool parameter is not valid. \ Should be type of Array.' ) unless origin.is_a?(Array) || origin.blank? end;T;+To; ; F; ; ;;;I">Pubnub::Validator::CommonValidator#validate_subscribe_key;F;[[I"subscribe_key;T0[I" required;TI" false;T;[[@i;T;:validate_subscribe_key;;;[;{;IC;""Validates given subscribe key ;T; [;[;%I""Validates given subscribe key;T;&0;@;F;7o;8;9F;:i;;i;'@;(I"@def validate_subscribe_key(subscribe_key, required = false);T;)T;*I"~def validate_subscribe_key(subscribe_key, required = false) fail( InitializationError.new, 'Missing required :subscribe_key parameter.' ) if !subscribe_key && required fail( InitializationError.new, 'Subscribe key parameter is not valid. \ Should be type of String or Symbol.' ) unless [String, Symbol].include?(subscribe_key.class) end;T;+To; ; F; ; ;;;I"0;?0;@0;;B;'@;B@;C;;-@%;/IC;[;-@%;0IC;1{;2IC;1{;3T; IC;1{;3T;3T;4{;5[;[[@,i ;T;;;;;;;[;{;IC;" Validator for Publish event ;T; [;[;%I" Validator for Publish event;T;&0;@%;F;7o;8;9F;:i ;;i ;'@;I"Pubnub::Validator::Publish;F;+To;D;IC;[o; ; F; ;2;;;I"+Pubnub::Validator::Subscribe.validate!;F;[;[[I"'lib/pubnub/validators/subscribe.rb;Ti;F;;;;;[;{;IC;" ;T;@I;0;F; [;[;%I";T;&0;'@G;(I"def validate!;T;)T;*I"def validate! end;T;+T;-@G;.IC;[o;= ;>0;?0;@0;;B;'@;B@;C;;-@G;/IC;[;-@G;0IC;1{;2IC;1{;3T; IC;1{;3T;3T;4{;5[;[[@Ni ;T;;A;;;;;[;{;IC;" Validator for Publish event ;T; [;[;%I" Validator for Publish event;T;&0;@G;F;7o;8;9F;:i ;;i ;'@;I"!Pubnub::Validator::Subscribe;F;+T@;-@;.IC;[;-@;/IC;[;-@;0IC;1{;2IC;1{;3T; IC;1{;3T;3T;4{;5[;[ [@i [@,i [@Ni [@i ;T;:Validator;;;;;[;{;IC;"7Validator module that holds all validators modules ;T; [;[;%I"7Validator module that holds all validators modules;T;&0;@;F;7o;8;9F;:i;;i;'@A;I"Pubnub::Validator;F;+To; ;IC;[o; ; F; ; ;;;I")Pubnub::RequestDispatcher#initialize;F;[;[[I"%lib/pubnub/request_dispatcher.rb;Ti ;F;;J;;;[;{;IC;" ;T;@;0;F; [;[o;! ;"I" return;F;#I"(a new instance of RequestDispatcher;T;0;$[I"RequestDispatcher;F;@;%I";T;&0;'@};(I"def initialize;T;)T;*I"def initialize @connection = Net::HTTP::Persistent.new 'PubNub' @connection.proxy_from_env Pubnub.logger.debug('Pubnub') { 'Created new Request' } end;T;+To; ; F; ; ;;;I"+Pubnub::RequestDispatcher#send_request;F;[[I" event;T0;[[@i;F;;;;;[;{;IC;" ;T;@;0;F; [;[;%I";T;&0;'@};(I"def send_request(event);T;)T;*I"def send_request(event) Pubnub.logger.debug('Pubnub') { "Sending request for #{event.class}" } @connection.read_timeout = event.read_timeout @connection.open_timeout = event.open_timeout @connection.idle_timeout = event.idle_timeout @connection.request(event.uri) end;T;+T;-@};.IC;[;-@};/IC;[o;= ;>0;?0;@0;;;'@};B0;C;;-@};0IC;1{;2IC;1{;3T; IC;1{;3T;3T;4{;5[;[[@i ;T;:RequestDispatcher;;;;;[;{;IC;";Request actor configures request to send and sends it. ;T; [;[;%I";Request actor configures request to send and sends it.;T;&0;@};F;7o;8;9F;:i;;i;'@A;I"Pubnub::RequestDispatcher;F;0;?0;@0;;6;'@;B@;C0;+To; ;IC;[o; ; F; ; ;;;I"+Pubnub::ChannelRegistration#initialize;F;[[I" options;T0[I"app;T0;[[I".lib/pubnub/events/channel_registration.rb;Ti ;F;;J;;;[;{;IC;" ;T;@;0;F; [;[o;! ;"I" return;F;#I"*a new instance of ChannelRegistration;T;0;$[I"ChannelRegistration;F;@;%I";T;&0;'@;(I"!def initialize(options, app);T;)T;*I"}def initialize(options, app) @event = :channel_registration super @action = @action.to_sym unless @action.nil? end;T;+To; ; F; ; ;;S;I"+Pubnub::ChannelRegistration#parameters;F;[;[[@i;F;;L;;;[;{;IC;" ;T;@;0;F; [;[;%I";T;&0;'@;(I"def parameters;T;)T;*I"def parameters parameters = super if @action == :add && !@channel.blank? parameters.merge!(add: @channel.join(',')) end if @action == :remove && !@channel.blank? parameters.merge!(remove: @channel.join(',')) end parameters end;T;+To; ; F; ; ;;S;I"%Pubnub::ChannelRegistration#path;F;[;[[@i!;F;;V;;;[;{;IC;" ;T;@;0;F; [;[;%I";T;&0;'@;(I" def path;T;)T;*I"odef path head = "/v1/channel-registration/sub-key/#{@subscribe_key}/" body = case @action when :list_groups then body_list_groups when :list_namespaces then body_list_namespaces when :get then body_get when :add then body_add when :remove then body_remove else raise_action_key_error end head + body end;T;+To; ; F; ; ;;S;I"7Pubnub::ChannelRegistration#raise_action_key_error;F;[;[[@i0;F;:raise_action_key_error;;;[;{;IC;" ;T;@;0;F; [;[;%I";T;&0;'@;(I"def raise_action_key_error;T;)T;*I"def raise_action_key_error fail ArgumentError.new( object: self, message: 'ChannelRegistration requires proper :action key' ), 'ChannelRegistration requires proper :action key' end;T;+To; ; F; ; ;;S;I"1Pubnub::ChannelRegistration#body_list_groups;F;[;[[@i7;F;:body_list_groups;;;[;{;IC;" ;T;@;0;F; [;[;%I";T;&0;'@;(I"def body_list_groups;T;)T;*I"Cdef body_list_groups [ 'channel-group' ].join('/') end;T;+To; ; F; ; ;;S;I"5Pubnub::ChannelRegistration#body_list_namespaces;F;[;[[@i=;F;:body_list_namespaces;;;[;{;IC;" ;T;@;0;F; [;[;%I";T;&0;'@;(I"def body_list_namespaces;T;)T;*I"Cdef body_list_namespaces [ 'namespace' ].join('/') end;T;+To; ; F; ; ;;S;I")Pubnub::ChannelRegistration#body_get;F;[;[[@iC;F;: body_get;;;[;{;IC;" ;T;@;0;F; [;[;%I";T;&0;'@;(I"def body_get;T;)T;*I"def body_get [ ('namespace' unless @namespace_id.blank?), @namespace_id, 'channel-group', @group_id ].delete_if(&:blank?).join('/') end;T;+To; ; F; ; ;;S;I")Pubnub::ChannelRegistration#body_add;F;[;[[@iL;F;: body_add;;;[;{;IC;" ;T;@;0;F; [;[;%I";T;&0;'@;(I"def body_add;T;)T;*I"def body_add [ ('namespace' unless @namespace_id.blank?), @namespace_id, 'channel-group', @group_id ].delete_if(&:blank?).join('/') end;T;+To; ; F; ; ;;S;I",Pubnub::ChannelRegistration#body_remove;F;[;[[@iU;F;:body_remove;;;[;{;IC;" ;T;@(;0;F; [;[;%I";T;&0;'@;(I"def body_remove;T;)T;*I"def body_remove [ ('namespace' unless @namespace_id.blank?), @namespace_id, ('channel-group' unless @group_id.blank?), @group_id, ('remove' if @channel.blank?) ].delete_if(&:blank?).join('/') end;T;+To; ; F; ; ;;S;I"1Pubnub::ChannelRegistration#format_envelopes;F;[[I" response;T0;[[@i_;F;;N;;;[;{;IC;" ;T;@5;0;F; [;[;%I";T;&0;'@;(I"#def format_envelopes(response);T;)T;*I"def format_envelopes(response) parsed_response, error = Formatter.parse_json(response.body) error = response if parsed_response && response.code != '200' envelopes = if error [error_envelope(parsed_response, error)] else [valid_envelope(parsed_response)] end add_common_data_to_envelopes(envelopes, response) end;T;+To; ; F; ; ;;S;I"/Pubnub::ChannelRegistration#valid_envelope;F;[[I"parsed_response;T0;[[@im;F;;O;;;[;{;IC;" ;T;@D;0;F; [;[;%I";T;&0;'@;(I"(def valid_envelope(parsed_response);T;)T;*I"6def valid_envelope(parsed_response) Envelope.new( parsed_response: parsed_response, payload: parsed_response['payload'], service: parsed_response['service'], message: parsed_response['message'], status: parsed_response['status'], error: parsed_response['error'] ) end;T;+To; ; F; ; ;;S;I"/Pubnub::ChannelRegistration#error_envelope;F;[[I"parsed_response;T0[I" error;T0;[[@ix;F;;P;;;[;{;IC;" ;T;@S;0;F; [;[;%I";T;&0;'@;(I"/def error_envelope(parsed_response, error);T;)T;*I"def error_envelope(parsed_response, error) ErrorEnvelope.new( error: error, response_message: response_message(parsed_response) ) end;T;+T;-@;.IC;[;-@;/IC;[o;= ;>0;?0;@0;;;'@;B0;C;;-@;0IC;1{;2IC;1{;3T; IC;1{;3T;3T;4{;5[;[[@i ;T;:ChannelRegistration;;;;;[;{;IC;"-Holds channel_registration functionality ;T; [;[;%I"-Holds channel_registration functionality;T;&0;@;F;7o;8;9F;:i;;i;'@A;I" Pubnub::ChannelRegistration;F;0;?0;@0;;R;'@A;B@;C0;+T;-@A;.IC;[;-@A;/IC;[;-@A;0IC;1{;2IC;1{;EIC;1{;s@C;t@P;3T;GIC;1{;s@c;t@p;3T;3T; IC;1{;3T;3T;4{;5[;[0[@i[@i[@Fi[@gi[@i[@9i[@{i5[@i[@ i[@5 i[@/ i[@d i[@0i[@i[@i[@i[@fi[@i[@>i[@i[@i[@i[@ri[@i[@Bi[@i[@i[@i[@i[@)i[@i[@i[@,i[@i[@i[@Ni[@i[@i[@$i[@i[@i[@i[@i;T;: Pubnub;;;;;[;{;IC;"Toplevel Pubnub module. ;T; [;[;%I"Toplevel Pubnub module.;T;&0;@A;F;7o;8;9F;:i4;;i4;'@;I" Pubnub;F;-@;.IC;[;-@;/IC;[;-@;0IC;1{;2IC;1{;3T; IC;1{;3T;3T;4{;5[;[;F;;;;;;;[;{;IC;" ;T;@;0;F; [;[;%I";T;&0;'0;I";T;6@:Object#blank?@ :Object#present?@;O@A:Pubnub.logger@C:Pubnub.logger=@P:Pubnub.client@c:Pubnub.client=@p:Pubnub.new@~:Pubnub::PAM@:Pubnub::PAM#initialize@:Pubnub::PAM#signature@:Pubnub::PAM#parameters@:(Pubnub::PAM#variables_for_signature@:!Pubnub::PAM#format_envelopes@:Pubnub::PAM#valid_envelope@:Pubnub::PAM#error_envelope@:Pubnub::UUID@?:Pubnub::UUID.generate@A:Pubnub::Error@`:Pubnub::Error#env@b:Pubnub::Error#message@p:Pubnub::Error#initialize@}: Pubnub::Error#build_message@:Pubnub::Error#insert_value@:Pubnub::Error#log_error@:Pubnub::JSONParseError@: Pubnub::InitializationError@:Pubnub::ArgumentError@:Pubnub::RequestError@ :Pubnub::ResponseError@:Pubnub::Event@:Pubnub::Event#origin@:Pubnub::Event#callback@:!Pubnub::Event#error_callback@:Pubnub::Event#channel@:Pubnub::Event#open_timeout@:Pubnub::Event#read_timeout@:Pubnub::Event#idle_timeout@:Pubnub::Event#group@:$Pubnub::Event#presence_callback@ :Pubnub::Event#channels@:Pubnub::Event#initialize@#:Pubnub::Event#fire@9:Pubnub::Event#uri@F:Pubnub::Event#finalized?@S:Pubnub::Event#sync?@e:Pubnub::Event#secure_call@w:"Pubnub::Event#format_channels@:!Pubnub::Event#fire_callbacks@:Pubnub::Event#parameters@:/Pubnub::Event#add_common_data_to_envelopes@:Pubnub::Event#handle@:Pubnub::Event#connection@:0Pubnub::Event#create_variables_from_options@:Pubnub::Event#format_group@: Pubnub::Event#set_timestamp@:Pubnub::Event#current_time@:Pubnub::Event#encode_state@:Pubnub::Heart@0:Pubnub::Heart#initialize@2: Pubnub::Heart#start_beating@G:Pubnub::Heart#beat@T:Pubnub::Client@t:Pubnub::Client#env@v:Pubnub::Client::VERSION@:Pubnub::Client#initialize@:(Pubnub::Client#restart_subscription@:&Pubnub::Client#reset_subscription@:Pubnub::Client#subscribed?@:&Pubnub::Client#request_dispatcher@:+Pubnub::Client#kill_request_dispatcher@:Pubnub::Client#change_uuid@3:!Pubnub::Client#session_uuid=@J:Pubnub::Client#uuid=@^:Pubnub::Client#set_uuid=@r:"Pubnub::Client#current_origin@:Pubnub::Client#origin@:Pubnub::Client#timetoken@:Pubnub::Client#timetoken=@:Pubnub::Client#uuid@:Pubnub::Client#events@:Pubnub::Client#validate!@ :Pubnub::Client#setup_app@!:Pubnub::Client#prepare_env@8:!Pubnub::Client#generate_uuid@M:#Pubnub::Client#assign_defaults@b:Pubnub::Client#setup_pools@w:*Pubnub::Client#symbolize_options_keys@:"Pubnub::Client#default_values@:Pubnub::Client#clean_env@:Pubnub::Crypto@:Pubnub::Crypto#initialize@:Pubnub::Crypto#encrypt@:Pubnub::Crypto#decrypt@:Pubnub::Crypto#decryption@:Pubnub::Crypto#load_json@:Pubnub::VERSION@ :Pubnub::Message@( :%Pubnub::Message::InternalMessage@* :Pubnub::Message::Done@> : Pubnub::Message::Done#actor@@ :%Pubnub::Message::Done#initialize@M :Pubnub::Message::Stop@t :!Pubnub::Message::Stop#reason@v :%Pubnub::Message::Stop#initialize@ :%Pubnub::Message::AddSubscription@ :+Pubnub::Message::AddSubscription#event@ :0Pubnub::Message::AddSubscription#initialize@ :(Pubnub::Message::RemoveSubscription@ :.Pubnub::Message::RemoveSubscription#event@ :3Pubnub::Message::RemoveSubscription#initialize@ :Pubnub::Envelope@( :Pubnub::Envelope#first@* :Pubnub::Envelope#first=@8 :Pubnub::Envelope#last@K :Pubnub::Envelope#last=@X :Pubnub::Envelope#object@k :Pubnub::Envelope#object=@x :Pubnub::Envelope#response@ :Pubnub::Envelope#response=@ :%Pubnub::Envelope#parsed_response@ :&Pubnub::Envelope#parsed_response=@ :Pubnub::Envelope#status@ :Pubnub::Envelope#status=@ :Pubnub::Envelope#channel@ :Pubnub::Envelope#channel=@ :Pubnub::Envelope#message@ :Pubnub::Envelope#message=@ :Pubnub::Envelope#payload@+ :Pubnub::Envelope#payload=@8 :Pubnub::Envelope#service@K :Pubnub::Envelope#service=@Y :Pubnub::Envelope#timetoken@m : Pubnub::Envelope#timetoken=@z :&Pubnub::Envelope#response_message@ :'Pubnub::Envelope#response_message=@ :Pubnub::Envelope#error@ :Pubnub::Envelope#error=@ :Pubnub::Envelope#action@ :Pubnub::Envelope#action=@ :Pubnub::Envelope#uuid@ :Pubnub::Envelope#uuid=@ :Pubnub::Envelope#uuids@ :Pubnub::Envelope#uuids=@ :&Pubnub::Envelope#timetoken_update@- :'Pubnub::Envelope#timetoken_update=@< :Pubnub::Envelope#group@K :Pubnub::Envelope#group=@X :&Pubnub::Envelope#wildcard_channel@k :'Pubnub::Envelope#wildcard_channel=@x :#Pubnub::Envelope#history_start@ :$Pubnub::Envelope#history_start=@ :!Pubnub::Envelope#history_end@ :"Pubnub::Envelope#history_end=@ :Pubnub::Envelope#msg@ :!Pubnub::Envelope#status_code@ : Pubnub::Envelope#initialize@ :'Pubnub::Envelope#mark_as_timetoken@ :Pubnub::Envelope#error?@ :Pubnub::Envelope#last?@ :Pubnub::Envelope#first?@ :Pubnub::Formatter@X :%Pubnub::Formatter.format_channel@Z :#Pubnub::Formatter.format_group@n :.Pubnub::Formatter.format_presence_channel@ :%Pubnub::Formatter.format_message@ :&Pubnub::Formatter.classify_method@ :Pubnub::Formatter.encode@ :)Pubnub::Formatter.make_channel_array@ :!Pubnub::Formatter.parse_json@ :0Pubnub::Formatter.params_hash_to_url_params@ :'Pubnub::Formatter.channels_for_url@ :"Pubnub::Formatter.valid_json?@ :Pubnub::Time@%:Pubnub::Time#initialize@':Pubnub::Time#path@>:Pubnub::Time#timetoken@K:"Pubnub::Time#format_envelopes@Z: Pubnub::Time#valid_envelope@i: Pubnub::Time#error_envelope@x:Pubnub::SingleEvent@:+Pubnub::SingleEvent#request_dispatcher@:'Pubnub::SingleEvent#finalize_event@#:Pubnub::SingleEvent#path@3:"Pubnub::SingleEvent#timetoken@@:)Pubnub::SingleEvent#response_message@O:)Pubnub::SingleEvent#format_envelopes@^:'Pubnub::SingleEvent#valid_envelope@m:'Pubnub::SingleEvent#error_envelope@|:Pubnub::Audit@:Pubnub::Audit#initialize@:Pubnub::Audit#parameters@:Pubnub::Audit#path@:Pubnub::State@:Pubnub::State#initialize@:Pubnub::State#parameters@:Pubnub::State#path@ :#Pubnub::State#format_envelopes@:!Pubnub::State#valid_envelope@(:!Pubnub::State#error_envelope@7:Pubnub::Leave@[:Pubnub::Leave#initialize@]:Pubnub::Leave#fire@t:&Pubnub::Leave#remove_subscription@:'Pubnub::Leave#restart_subscription@:Pubnub::Leave#path@:#Pubnub::Leave#format_envelopes@:!Pubnub::Leave#valid_envelope@:!Pubnub::Leave#error_envelope@:Pubnub::Grant@:Pubnub::Grant#initialize@:Pubnub::Grant#parameters@:Pubnub::Grant#path@:Pubnub::Revoke@3:Pubnub::Revoke#initialize@5:Pubnub::Revoke#parameters@L:Pubnub::Revoke#path@\:Pubnub::Client::Events@:#Pubnub::Client::Events::EVENTS@:Pubnub::Configuration@:2Pubnub::Configuration::DEFAULT_ERROR_CALLBACK@:4Pubnub::Configuration::DEFAULT_CONNECT_CALLBACK@:0Pubnub::Configuration::DEFAULT_READ_TIMEOUT@:0Pubnub::Configuration::DEFAULT_OPEN_TIMEOUT@:0Pubnub::Configuration::DEFAULT_IDLE_TIMEOUT@:2Pubnub::Configuration::DEFAULT_S_READ_TIMEOUT@:2Pubnub::Configuration::DEFAULT_S_OPEN_TIMEOUT@:2Pubnub::Configuration::DEFAULT_S_IDLE_TIMEOUT@ :2Pubnub::Configuration::DEFAULT_H_READ_TIMEOUT@:2Pubnub::Configuration::DEFAULT_H_OPEN_TIMEOUT@&:2Pubnub::Configuration::DEFAULT_H_IDLE_TIMEOUT@3:6Pubnub::Configuration::DEFAULT_RECONNECT_ATTEMPTS@@:6Pubnub::Configuration::DEFAULT_RECONNECT_INTERVAL@M:0Pubnub::Configuration::DEFAULT_ORIGINS_POOL@Z:(Pubnub::Configuration::DEFAULT_PORT@g:3Pubnub::Configuration::PERIODIC_TIMER_INTERVAL@t:'Pubnub::Configuration::DEFAULT_TTL@:Pubnub::OriginManager@|:$Pubnub::OriginManager#last_ping@~:#Pubnub::OriginManager#failback@:%Pubnub::OriginManager#initialize@: Pubnub::OriginManager#start@:)Pubnub::OriginManager#current_origin@:)Pubnub::OriginManager#online_origins@:*Pubnub::OriginManager#offline_origins@:&Pubnub::OriginManager#test_origin@:+Pubnub::OriginManager#alive_and_valid?@:*Pubnub::OriginManager#response_valid?@:,Pubnub::OriginManager#get_ping_response@:Pubnub::OriginManager#ping@':%Pubnub::OriginManager#bring_down@6:#Pubnub::OriginManager#bring_up@E:Pubnub::ErrorEnvelope@h:%Pubnub::ErrorEnvelope#initialize@j:!Pubnub::ErrorEnvelope#error?@:,Pubnub::ErrorEnvelope#set_error_message@:Pubnub::Publish@:Pubnub::Publish#initialize@:Pubnub::Publish#path@:Pubnub::Publish#timetoken@:%Pubnub::Publish#response_message@:%Pubnub::Publish#format_envelopes@:#Pubnub::Publish#valid_envelope@:#Pubnub::Publish#error_envelope@:Pubnub::History@7:Pubnub::History#initialize@9:Pubnub::History#timetoken@P:%Pubnub::History#response_message@_:Pubnub::History#path@n:Pubnub::History#parameters@{:%Pubnub::History#format_envelopes@:$Pubnub::History#valid_envelopes@:#Pubnub::History#error_envelope@:Pubnub::SubscribeEvent@:!Pubnub::SubscribeEvent#heart@:&Pubnub::SubscribeEvent#initialize@: Pubnub::SubscribeEvent#fire@:%Pubnub::SubscribeEvent#leave_all@:(Pubnub::SubscribeEvent#send_request@ :*Pubnub::SubscribeEvent#setup_cb_pools@:.Pubnub::SubscribeEvent#request_dispatcher@$:*Pubnub::SubscribeEvent#fire_callbacks@1:0Pubnub::SubscribeEvent#fire_async_callbacks@@:1Pubnub::SubscribeEvent#fire_success_callback@O:/Pubnub::SubscribeEvent#fire_error_callback@^:*Pubnub::SubscribeEvent#finalize_event@m: Pubnub::SubscribeEvent#path@|:&Pubnub::SubscribeEvent#parameters@:Pubnub::Presence@: Pubnub::Presence#initialize@:%Pubnub::Presence#format_channels@:Pubnub::HereNow@ :Pubnub::HereNow#initialize@ :Pubnub::HereNow#path@":!Pubnub::HereNow#channel_path@/: Pubnub::HereNow#global_path@<:Pubnub::HereNow#parameters@I:%Pubnub::HereNow#format_envelopes@V:#Pubnub::HereNow#valid_envelope@e:#Pubnub::HereNow#error_envelope@t:Pubnub::Heartbeat@:!Pubnub::Heartbeat#initialize@:Pubnub::Heartbeat#path@:!Pubnub::Heartbeat#parameters@:#Pubnub::Heartbeat#encode_state@:'Pubnub::Heartbeat#format_envelopes@:%Pubnub::Heartbeat#valid_envelope@:%Pubnub::Heartbeat#error_envelope@:Pubnub::WhereNow@: Pubnub::WhereNow#initialize@ :Pubnub::WhereNow#path@7:&Pubnub::WhereNow#format_envelopes@D:$Pubnub::WhereNow#valid_envelope@S:$Pubnub::WhereNow#error_envelope@b:Pubnub::Subscribe@:!Pubnub::Subscribe#initialize@:Pubnub::Validator@:Pubnub::Validator::Client@:(Pubnub::Validator::Client.validate!@:Pubnub::Validator::Publish@%:)Pubnub::Validator::Publish.validate!@':Pubnub::RequestDispatcher@}:)Pubnub::RequestDispatcher#initialize@:+Pubnub::RequestDispatcher#send_request@: Pubnub::Client::Connections@:/Pubnub::Client::Connections#setup_conn_for@:Pubnub::Validator::CommonValidator#validate_subscribe_key@: