Method: Scrubyt::Pattern#check_if_detail_page
- Defined in:
- lib/scrubyt/core/scraping/pattern.rb
#check_if_detail_page(block) ⇒ Object
Check whether the currently created pattern is a detail pattern (i.e. it refrences a subextractor). Also check if the currently created pattern is an ancestor of a detail pattern , and store this in a hash if yes (to be able to traverse the pattern structure on detail pages as well).
162 163 164 165 166 167 |
# File 'lib/scrubyt/core/scraping/pattern.rb', line 162 def check_if_detail_page(block) if @name =~ /.+_detail/ @options[:type] = :detail_page @referenced_extractor = block end end |