Sha256: 4ace8264166501d553f8760ffe2609fc96edfec0c4d716b7a1add3a2a0df307d

Contents?: true

Size: 500 Bytes

Versions: 6

Compression:

Stored size: 500 Bytes

Contents

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

6 entries across 6 versions & 1 rubygems

Version Path
rack-simple_user_agent-0.4.0 lib/rack/simple_user_agent/detectors/bot.rb
rack-simple_user_agent-0.3.0 lib/rack/simple_user_agent/detectors/bot.rb
rack-simple_user_agent-0.3.0.rc lib/rack/simple_user_agent/detectors/bot.rb
rack-simple_user_agent-0.2.2 lib/rack/simple_user_agent/detectors/bot.rb
rack-simple_user_agent-0.2.1 lib/rack/simple_user_agent/detectors/bot.rb
rack-simple_user_agent-0.2.0 lib/rack/simple_user_agent/detectors/bot.rb