Module: SpiderCore::PaginationDSL
- Included in:
- MicroSpider
- Defined in:
- lib/spider_core/pagination_dsl.rb
Instance Attribute Summary collapse
-
#next_page ⇒ Object
Returns the value of attribute next_page.
-
#skip_pages ⇒ Object
Returns the value of attribute skip_pages.
Instance Method Summary collapse
Instance Attribute Details
#next_page ⇒ Object
Returns the value of attribute next_page.
4 5 6 |
# File 'lib/spider_core/pagination_dsl.rb', line 4 def next_page @next_page end |
#skip_pages ⇒ Object
Returns the value of attribute skip_pages.
4 5 6 |
# File 'lib/spider_core/pagination_dsl.rb', line 4 def skip_pages @skip_pages end |
Instance Method Details
#keep_eyes_on_next_page(pattern, attr: :href, &block) ⇒ Object
6 7 8 9 10 11 12 |
# File 'lib/spider_core/pagination_dsl.rb', line 6 def keep_eyes_on_next_page(pattern, attr: :href, &block) actions << lambda { element = first(pattern) path = block_given? ? yield(element) : element && element[:href] @paths.unshift(path) if path } end |