Sha256: b1e82c312428cb13d36aa3b23fc72166dc134f95da471c911e5d93ba8b52c58e

Contents?: true

Size: 443 Bytes

Versions: 3

Compression:

Stored size: 443 Bytes

Contents

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

3 entries across 3 versions & 1 rubygems

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