Module: Browser::Bots
- Included in:
- Browser
- Defined in:
- lib/browser/methods/bots.rb
Constant Summary collapse
- BOTS =
YAML.load_file(root.join("bots.yml"))
- SEARCH_ENGINES =
YAML.load_file(root.join("search_engines.yml"))
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
Instance Method Details
#bot? ⇒ Boolean
11 12 13 |
# File 'lib/browser/methods/bots.rb', line 11 def bot? BOTS.any? {|key, _| ua.include?(key) } end |
#search_engine? ⇒ Boolean
15 16 17 |
# File 'lib/browser/methods/bots.rb', line 15 def search_engine? SEARCH_ENGINES.any? {|key, _| ua.include?(key) } end |