Sha256: 43de08d643ea7ec90678f95294297d3da650e09ea8ec6556f64fcbebe8158b28

Contents?: true

Size: 735 Bytes

Versions: 3

Compression:

Stored size: 735 Bytes

Contents

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

3 entries across 3 versions & 1 rubygems

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