Sha256: 623b9bfbffacb9acb1b5e37c66427ebd46b358b0532d71b4514d57126efd1e1a

Contents?: true

Size: 498 Bytes

Versions: 23

Compression:

Stored size: 498 Bytes

Contents

module TrackerApi
  module Endpoints
    class Notifications
      attr_accessor :client

      def initialize(client)
        @client = client
      end

      def get(params={})
        data = client.paginate('/my/notifications', params: params)
        raise Errors::UnexpectedData, 'Array of notifications expected' unless data.is_a? Array

        data.map do |notification|
          Resources::Notification.new({ client: client }.merge(notification))
        end
      end
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
tracker_api-1.16.0 lib/tracker_api/endpoints/notifications.rb
tracker_api-1.15.0 lib/tracker_api/endpoints/notifications.rb
tracker_api-1.14.0 lib/tracker_api/endpoints/notifications.rb
tracker_api-1.13.0 lib/tracker_api/endpoints/notifications.rb
tracker_api-1.12.0 lib/tracker_api/endpoints/notifications.rb
tracker_api-1.11.0 lib/tracker_api/endpoints/notifications.rb
tracker_api-1.10.0 lib/tracker_api/endpoints/notifications.rb
tracker_api-1.9.1 lib/tracker_api/endpoints/notifications.rb
tracker_api-1.9.0 lib/tracker_api/endpoints/notifications.rb
tracker_api-1.8.0 lib/tracker_api/endpoints/notifications.rb
tracker_api-1.7.1 lib/tracker_api/endpoints/notifications.rb
tracker_api-1.7.0 lib/tracker_api/endpoints/notifications.rb
tracker_api-1.6.0 lib/tracker_api/endpoints/notifications.rb
tracker_api-1.5.0 lib/tracker_api/endpoints/notifications.rb
tracker_api-1.4.1 lib/tracker_api/endpoints/notifications.rb
tracker_api-1.4.0 lib/tracker_api/endpoints/notifications.rb
tracker_api-1.3.0 lib/tracker_api/endpoints/notifications.rb
tracker_api-1.2.1 lib/tracker_api/endpoints/notifications.rb
tracker_api-1.1.1 lib/tracker_api/endpoints/notifications.rb
tracker_api-1.1.0 lib/tracker_api/endpoints/notifications.rb