Class: Pennyworth::Loaders::Rodauth

Inherits:
Object
  • Object
show all
Defined in:
lib/pennyworth/loaders/rodauth.rb

Overview

Loads Rodauth documentation by scraping the web page.

Instance Method Summary collapse

Constructor Details

#initialize(parser: Nokogiri::HTML5, model: Models::Rodauth) ⇒ Rodauth

Returns a new instance of Rodauth.



15
16
17
18
19
# File 'lib/pennyworth/loaders/rodauth.rb', line 15

def initialize(parser: Nokogiri::HTML5, model: Models::Rodauth, **)
  @parser = parser
  @model = model
  super(**)
end

Instance Method Details

#call(uri) ⇒ Object



21
22
23
24
25
# File 'lib/pennyworth/loaders/rodauth.rb', line 21

def call uri
  fetch(uri).then { parse_items it }
            .each
            .with_object([]) { |item, entries| entries.append build_record(item) }
end