Class: Relaton::Calconnect::Scraper
- Inherits:
-
Object
- Object
- Relaton::Calconnect::Scraper
- Includes:
- Core::ArrayWrapper, Core::HashKeysSymbolizer
- Defined in:
- lib/relaton/calconnect/scraper.rb
Constant Summary collapse
- DOMAIN =
"https://standards.calconnect.org/".freeze
Instance Method Summary collapse
-
#initialize(errors = {}) ⇒ Scraper
constructor
A new instance of Scraper.
-
#parse_page(hit) ⇒ Relaton::Calconnect::ItemData
Parse document page.
Constructor Details
#initialize(errors = {}) ⇒ Scraper
Returns a new instance of Scraper.
15 16 17 |
# File 'lib/relaton/calconnect/scraper.rb', line 15 def initialize(errors = {}) @errors = errors end |
Instance Method Details
#parse_page(hit) ⇒ Relaton::Calconnect::ItemData
Parse document page
26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/relaton/calconnect/scraper.rb', line 26 def parse_page(hit) # rubocop:disable Metrics/AbcSize, Metrics/MethodLength hash = symbolize_hash_keys hit links = array(hash[:link]) link = links.detect { |l| l[:type] == "rxl" } if link bib = fetch_bib_xml link[:content] update_links bib, links else hash.delete :fetched bib = hash_to_item hash end update_sources bib bib end |