module CrawlerDetect
@since 0.1.0
@since 0.1.0
Constants
- VERSION
Public Class Methods
config()
click to toggle source
@since 1.0.0 @return [CrawlerDetect::Config] Instance of configuration class
# File lib/crawler_detect.rb, line 40 def config @config ||= CrawlerDetect::Config.new end
is_crawler?(user_agent)
click to toggle source
@param user_agent [String] User-agent string to detect @return [true, false] Is User-agent a crawler?
# File lib/crawler_detect.rb, line 27 def is_crawler?(user_agent) detector(user_agent).is_crawler? end
new(user_agent)
click to toggle source
@param user_agent [String] User-agent string to detect @return [CrawlerDetect::Detector] Instance of detector class
# File lib/crawler_detect.rb, line 21 def new(user_agent) detector(user_agent) end
setup!(&config)
click to toggle source
@since 1.0.0 @param config [Proc]
# File lib/crawler_detect.rb, line 33 def setup!(&config) @config = CrawlerDetect::Config.new(&config) Library.reset_cache end
Private Class Methods
detector(user_agent)
click to toggle source
# File lib/crawler_detect.rb, line 46 def detector(user_agent) CrawlerDetect::Detector.new(user_agent) end