Class: Pennyworth::Loaders::RFC
- Inherits:
-
Object
- Object
- Pennyworth::Loaders::RFC
- Defined in:
- lib/pennyworth/loaders/rfc.rb
Overview
Loads RFC records by scraping web page.
Instance Method Summary collapse
- #call(uri) ⇒ Object
-
#initialize(parser: Nokogiri::HTML5, model: Models::RFC) ⇒ RFC
constructor
A new instance of RFC.
Constructor Details
Instance Method Details
#call(uri) ⇒ Object
18 19 20 21 22 23 24 25 26 27 |
# File 'lib/pennyworth/loaders/rfc.rb', line 18 def call uri fetch(uri).then { parse_rows it } .each .with_object [] do |row, entries| row.children in Nokogiri::XML::Element => label, Nokogiri::XML::Element => description, Nokogiri::XML::Element => published entries.append build_record(label, description, published) end end |