Class: HubLink::Batch

Inherits:
Object
  • Object
show all
Defined in:
lib/hub_link/batch.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(query) ⇒ Batch

Returns a new instance of Batch.



5
6
7
# File 'lib/hub_link/batch.rb', line 5

def initialize(query)
  @query = query
end

Instance Attribute Details

#queryObject (readonly)

Returns the value of attribute query.



3
4
5
# File 'lib/hub_link/batch.rb', line 3

def query
  @query
end

Instance Method Details

#pull_requestsObject



9
10
11
# File 'lib/hub_link/batch.rb', line 9

def pull_requests
  results.map(&:to_h)
end

#review_requestsObject



17
18
19
# File 'lib/hub_link/batch.rb', line 17

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

#reviewsObject



13
14
15
# File 'lib/hub_link/batch.rb', line 13

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