Module: DevDoc::Test::PseudoI18nCrawler::Scanner

Defined in:
lib/dev_doc/test/pseudo_i18n_crawler.rb

Overview

Scan every crawled JSON-UI response as it is fetched.

Instance Method Summary collapse

Instance Method Details

#fetch(method, url, action, params = {}, inspect_result = true) ⇒ Object

Signature must mirror Glib::JsonCrawler::Http#fetch for the prepend/super override to work, so the boolean positional arg can't become a kwarg.



83
84
85
86
87
88
89
90
# File 'lib/dev_doc/test/pseudo_i18n_crawler.rb', line 83

def fetch(method, url, action, params = {}, inspect_result = true) # rubocop:disable Style/OptionalBooleanParameter
  result = super
  if method == :get
    rec = instance_variable_get(:@content_history)&.last
    PseudoI18nCrawler.host_class.scan_body(url, rec[:response]) if rec && rec[:url] == url
  end
  result
end