Sha256: 423f81936a0d5417cb17d13b73701f5f4081c6e8a43d4496a07f9cbf9aedb1dd

Contents?: true

Size: 600 Bytes

Versions: 1

Compression:

Stored size: 600 Bytes

Contents

class Ghn
  class Collector
    def initialize(client, repo_full_name = nil)
      @client = client
      @repo_full_name = repo_full_name
    end

    def collect(page = 1)
      notifications = if @repo_full_name
                        @client.repo_notifications(@repo_full_name, page: page)
                      else
                        @client.notifications(page: page)
                      end
      @count = notifications.count
      notifications.map { |notification|
        Notification.new(notification).to_url
      }
    end

    def has_next?
      @count == 50
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ghn-2.0.0.pre1 lib/ghn/collector.rb