Sha256: 14a8becae8e054d30e09c47456357a160a82612f916fa04e027bcc61a6feee20

Contents?: true

Size: 428 Bytes

Versions: 7

Compression:

Stored size: 428 Bytes

Contents

module HubLink
  class Batch
    attr_reader :query

    def initialize(query)
      @query = query
    end

    def pull_requests
      results.map(&:to_h)
    end

    def reviews
      results.flat_map(&:reviews).map(&:to_h)
    end

    def review_requests
      results.flat_map(&:review_requests).map(&:to_h)
    end

    private

      def results
        @_results ||= Api::PullRequest.search(query)
      end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
hub_link-0.10.0 lib/hub_link/batch.rb
hub_link-0.9.1 lib/hub_link/batch.rb
hub_link-0.9.0 lib/hub_link/batch.rb
hub_link-0.8.0 lib/hub_link/batch.rb
hub_link-0.7.0 lib/hub_link/batch.rb
hub_link-0.6.0 lib/hub_link/batch.rb
hub_link-0.5.0 lib/hub_link/batch.rb