Class: Hexabat::Importer
- Inherits:
-
Object
- Object
- Hexabat::Importer
- Defined in:
- lib/hexabat/importer.rb
Instance Method Summary collapse
- #first_page_retrieved(state) ⇒ Object
- #import ⇒ Object
-
#initialize(issue_counter, request_creator) ⇒ Importer
constructor
A new instance of Importer.
- #last_page_retrieved(state) ⇒ Object
Constructor Details
#initialize(issue_counter, request_creator) ⇒ Importer
Returns a new instance of Importer.
3 4 5 6 |
# File 'lib/hexabat/importer.rb', line 3 def initialize(issue_counter, request_creator) @issue_counter = issue_counter @request_creator = request_creator end |
Instance Method Details
#first_page_retrieved(state) ⇒ Object
13 14 15 16 17 18 |
# File 'lib/hexabat/importer.rb', line 13 def first_page_retrieved(state) ->(page_range, issue_count) do notify_counted_page :first, state, page_range, issue_count retrieve_last_page_of_issues state, page_range.last if page_range.multiple_pages? end end |
#import ⇒ Object
8 9 10 11 |
# File 'lib/hexabat/importer.rb', line 8 def import retrieve_first_page_of_issues :open retrieve_first_page_of_issues :closed end |
#last_page_retrieved(state) ⇒ Object
20 21 22 23 24 25 |
# File 'lib/hexabat/importer.rb', line 20 def last_page_retrieved(state) ->(page_range, issue_count) do notify_counted_page :last, state, page_range, issue_count retrieve_pages_of_issues state, page_range.middle end end |