Sha256: e529037925940627393514437eba12c11a70405ef215cffd0b13a9c87d71a921

Contents?: true

Size: 474 Bytes

Versions: 5

Compression:

Stored size: 474 Bytes

Contents

# frozen_string_literal: true

module Rack
  class SimpleUserAgent
    module Detectors
      module Ios
        def from_ios?
          from_iphone? || from_ipad? || from_ipod?
        end

        def from_iphone?
          user_agent_string.include?('iPhone;')
        end

        def from_ipad?
          user_agent_string.include?('iPad;')
        end

        def from_ipod?
          user_agent_string.include?('iPod touch;')
        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/ios.rb
rack-simple_user_agent-1.1.0 lib/rack/simple_user_agent/detectors/ios.rb
rack-simple_user_agent-1.0.0 lib/rack/simple_user_agent/detectors/ios.rb
rack-simple_user_agent-0.6.0 lib/rack/simple_user_agent/detectors/ios.rb
rack-simple_user_agent-0.5.0 lib/rack/simple_user_agent/detectors/ios.rb