Class: BrowserCrawler::Reports::YamlReport

Inherits:
Object
  • Object
show all
Defined in:
lib/browser_crawler/reports/yaml_report.rb

Overview

It involves methods which allow to save a store to an yaml file

Instance Method Summary collapse

Constructor Details

#initialize(store:) ⇒ YamlReport

Returns a new instance of YamlReport.



5
6
7
# File 'lib/browser_crawler/reports/yaml_report.rb', line 5

def initialize(store:)
  @store = store
end

Instance Method Details

#export(save_folder_path:) ⇒ Object



9
10
11
12
# File 'lib/browser_crawler/reports/yaml_report.rb', line 9

def export(save_folder_path:)
  File.write("#{save_folder_path}/crawler_report.yaml",
             @store.to_h.to_yaml)
end