Module: CrawlerDetect::Library::Loader

Included in:
Crawlers, Exclusions, Headers
Defined in:
lib/crawler_detect/library/loader.rb

Overview

since 1.0.0

Since:

  • 0.1.0

Instance Method Summary collapse

Instance Method Details

#load_raw(path) ⇒ Object

Load JSON raw file

Since:

  • 0.1.0



8
9
10
# File 'lib/crawler_detect/library/loader.rb', line 8

def load_raw(path)
  JSON.parse(File.read(path))
end

#reload_dataObject

Remove cached raw data

Since:

  • 0.1.0



13
14
15
# File 'lib/crawler_detect/library/loader.rb', line 13

def reload_data
  remove_instance_variable(:@data) if instance_variable_defined?(:@data)
end