Sha256: 926235fc721f596feac9feef875e84ddcc4a21abf1d52f6ef4e42e889250c8f1

Contents?: true

Size: 513 Bytes

Versions: 5

Compression:

Stored size: 513 Bytes

Contents

# frozen_string_literal: true

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

5 entries across 5 versions & 1 rubygems

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