Sha256: 9b519f2e89a3d0ace9332d20697616c3961a9c960c945529e04c71cf1486d29a

Contents?: true

Size: 668 Bytes

Versions: 5

Compression:

Stored size: 668 Bytes

Contents

module ActionDispatch

  class Request

    def human?
      voight_kampff_test.human?
    end
    
    def bot?
      voight_kampff_test.bot?
    end
    alias :replicant? :bot?

    def browser?
      voight_kampff_test.browser?
    end

    def checker?
      voight_kampff_test.checker?
    end
    
    def downloader?
      voight_kampff_test.downloader?
    end
    
    def proxy?
      voight_kampff_test.proxy?
    end

    def crawler?
      voight_kampff_test.crawler?
    end

    def spam?
      voight_kampff_test.spam?
    end

    private
    
    def voight_kampff_test
      @voight_kampff ||= VoightKampff::Test.new(user_agent)
    end

  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
voight_kampff-0.1.4 config/initializers/extend_action_dispatch_requset.rb
voight_kampff-0.1.3 config/initializers/extend_action_dispatch_requset.rb
voight_kampff-0.1.2 config/initializers/extend_action_dispatch_requset.rb
voight_kampff-0.1.1 config/initializers/extend_action_dispatch_requset.rb
voight_kampff-0.1.0 config/initializers/extend_action_dispatch_requset.rb