Sha256: 08fb4b948d8ba4541dd3de35deb035a474b999cc6e0cfa988c873a7e67d2a5f3

Contents?: true

Size: 531 Bytes

Versions: 5

Compression:

Stored size: 531 Bytes

Contents

# frozen_string_literal: true

module Rack
  class SimpleUserAgent
    module Detectors
      module Bot
        def from_googlebot?
          user_agent_string.include?('Googlebot')
        end

        def from_googlebot_news?
          user_agent_string.include?('Googlebot-News')
        end

        def from_googlebot_images?
          user_agent_string.include?('Googlebot-Image')
        end

        def from_googlebot_video?
          user_agent_string.include?('Googlebot-Video')
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rack-simple_user_agent-1.1.1 lib/rack/simple_user_agent/detectors/bot.rb
rack-simple_user_agent-1.1.0 lib/rack/simple_user_agent/detectors/bot.rb
rack-simple_user_agent-1.0.0 lib/rack/simple_user_agent/detectors/bot.rb
rack-simple_user_agent-0.6.0 lib/rack/simple_user_agent/detectors/bot.rb
rack-simple_user_agent-0.5.0 lib/rack/simple_user_agent/detectors/bot.rb