lib/pushbullet/client.rb in pushbullet_client-0.0.5 vs lib/pushbullet/client.rb in pushbullet_client-0.0.6

- old
+ new

@@ -42,10 +42,14 @@ private def authorise_and_send(http_method:, path:, payload: {}, params: {}) start_time = micro_second_time_now + if params.nil? || params.empty? + params = {} + end + params['limit'] = @limit response = HTTParty.send( http_method.to_sym, construct_base_path(path, params), @@ -74,11 +78,12 @@ total_time = end_time - start_time { 'start_time' => start_time, 'end_time' => end_time, - 'total_time' => total_time + 'total_time' => total_time, + 'cursor' => response.dig('cursor') } end def body_is_present?(response) !body_is_missing?(response) @@ -114,8 +119,14 @@ end end def process_params(params) params.keys.map { |key| "#{key}=#{params[key]}" }.join('&') + end + + def process_cursor(cursor, params: {}) + unless cursor.nil? || cursor.empty? + params['cursor'] = cursor + end end end end