Sha256: 8c7ef7796b3b995faf3dcf81372a21ef99c98359c59fea9c90bf6b61655b31f5

Contents?: true

Size: 482 Bytes

Versions: 3

Compression:

Stored size: 482 Bytes

Contents

module Rack
  class SimpleUserAgent
    module Detectors
      module Android
        def from_android?
          user_agent_string.include?("Android")
        end

        def from_android_tablet?
          from_android? && !android_mobile?
        end

        def from_android_mobile?
          from_android? && android_mobile?
        end

        private

        def android_mobile?
          !(user_agent =~ /Android.+Mobi(le)?/).nil?
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rack-simple_user_agent-0.4.0 lib/rack/simple_user_agent/detectors/android.rb
rack-simple_user_agent-0.3.0 lib/rack/simple_user_agent/detectors/android.rb
rack-simple_user_agent-0.3.0.rc lib/rack/simple_user_agent/detectors/android.rb