Sha256: 920ba0da78fc5f405105d5a7e77735b8a94689b7a56536d4c78c70a1bd59ce0e

Contents?: true

Size: 766 Bytes

Versions: 5

Compression:

Stored size: 766 Bytes

Contents

# frozen_string_literal: true

require 'rack/simple_user_agent/detectors/android'
require 'rack/simple_user_agent/detectors/bot'
require 'rack/simple_user_agent/detectors/ios'
require 'rack/simple_user_agent/detectors/windows_phone'

module Rack
  class SimpleUserAgent
    module Detectors
      include Android
      include Bot
      include Ios
      include WindowsPhone

      def from_smartdevice?
        from_ios? || from_android? || from_windows_phone?
      end

      def from_smartphone?
        from_iphone? || from_ipod? || from_android_mobile? || from_windows_phone?
      end

      def from_tablet?
        from_ipad? || from_android_tablet?
      end

      private

      def user_agent_string
        user_agent.to_s
      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.rb
rack-simple_user_agent-1.1.0 lib/rack/simple_user_agent/detectors.rb
rack-simple_user_agent-1.0.0 lib/rack/simple_user_agent/detectors.rb
rack-simple_user_agent-0.6.0 lib/rack/simple_user_agent/detectors.rb
rack-simple_user_agent-0.5.0 lib/rack/simple_user_agent/detectors.rb