Sha256: ffc1164386907de078c46b8f4f48f043e77e4dcff55db1a6c33332256fc25f10

Contents?: true

Size: 435 Bytes

Versions: 23

Compression:

Stored size: 435 Bytes

Contents

module Notifications
  class Client
    class NotificationsCollection
      attr_reader :links,
                  :collection

      def initialize(response)
        @links = response["links"]
        @collection = collection_from(response["notifications"])
      end

      def collection_from(notifications)
        notifications.map do |notification|
          Notification.new(notification)
        end
      end
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
notifications-ruby-client-6.2.0 lib/notifications/client/notifications_collection.rb
notifications-ruby-client-6.0.0 lib/notifications/client/notifications_collection.rb
notifications-ruby-client-5.4.0 lib/notifications/client/notifications_collection.rb
notifications-ruby-client-5.3.0 lib/notifications/client/notifications_collection.rb
notifications-ruby-client-5.2.0 lib/notifications/client/notifications_collection.rb
notifications-ruby-client-5.1.2 lib/notifications/client/notifications_collection.rb
notifications-ruby-client-5.1.1 lib/notifications/client/notifications_collection.rb
notifications-ruby-client-5.1.0 lib/notifications/client/notifications_collection.rb
notifications-ruby-client-4.0.0 lib/notifications/client/notifications_collection.rb
notifications-ruby-client-3.1.0 lib/notifications/client/notifications_collection.rb
notifications-ruby-client-3.0.0 lib/notifications/client/notifications_collection.rb
notifications-ruby-client-2.10.0 lib/notifications/client/notifications_collection.rb
notifications-ruby-client-2.9.0 lib/notifications/client/notifications_collection.rb
notifications-ruby-client-2.8.0 lib/notifications/client/notifications_collection.rb
notifications-ruby-client-2.7.0 lib/notifications/client/notifications_collection.rb
notifications-ruby-client-2.6.0 lib/notifications/client/notifications_collection.rb
notifications-ruby-client-2.5.1 lib/notifications/client/notifications_collection.rb
notifications-ruby-client-2.5.0 lib/notifications/client/notifications_collection.rb
notifications-ruby-client-2.4.0 lib/notifications/client/notifications_collection.rb
notifications-ruby-client-2.3.0 lib/notifications/client/notifications_collection.rb