Class: HubLink::Batch
- Inherits:
-
Object
- Object
- HubLink::Batch
- Defined in:
- lib/hub_link/batch.rb
Instance Attribute Summary collapse
-
#query ⇒ Object
readonly
Returns the value of attribute query.
Instance Method Summary collapse
-
#initialize(query) ⇒ Batch
constructor
A new instance of Batch.
- #pull_requests ⇒ Object
- #review_requests ⇒ Object
- #reviews ⇒ Object
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
#query ⇒ Object (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_requests ⇒ Object
9 10 11 |
# File 'lib/hub_link/batch.rb', line 9 def pull_requests results.map(&:to_h) end |
#review_requests ⇒ Object
17 18 19 |
# File 'lib/hub_link/batch.rb', line 17 def review_requests results.flat_map(&:review_requests).map(&:to_h) end |
#reviews ⇒ Object
13 14 15 |
# File 'lib/hub_link/batch.rb', line 13 def reviews results.flat_map(&:reviews).map(&:to_h) end |