Sha256: 6c8ec2f8a1e3836fc9708de5d9943a22984c8a0ed1fdba0874b7b3bf305ead36

Contents?: true

Size: 239 Bytes

Versions: 6

Compression:

Stored size: 239 Bytes

Contents

# Reopen the Rack::Request class to add bot detection methods
class Rack::Request
  def human?
    VoightKampff::Test.new(user_agent).human?
  end

  def bot?
    VoightKampff::Test.new(user_agent).bot?
  end
  alias :replicant? :bot?
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
voight_kampff-1.1.0 lib/voight_kampff/rack_request.rb
voight_kampff-1.0.4 lib/voight_kampff/rack_request.rb
voight_kampff-1.0.3 lib/voight_kampff/rack_request.rb
voight_kampff-1.0.2 lib/voight_kampff/rack_request.rb
voight_kampff-1.0.1 lib/voight_kampff/rack_request.rb
voight_kampff-1.0.0 lib/voight_kampff/rack_request.rb