struct

DeviceDetector::Parser::Mobile

Inherits DeviceDetector::Helper < Struct < Value < Object

Constants

ANDROID_BUILD_MODEL_REGEX = /Android [^;]+; ([^;)]+?)(?: Build|[;)])/i
ANDROID_MODEL_SHORTCUTS = {"SM-G991B" => {"Samsung", "smartphone", "Galaxy S21 5G"}, "Pixel 7" => {"Google", "smartphone", "Pixel 7"}, "M2101K9G" => {"Xiaomi", "smartphone", "Mi 11 Lite 5G"}, "BV6000" => {"Blackview", "smartphone", "BV6000"}, "CPH2207" => {"OPPO", "smartphone", "Reno 5 Pro 5G"}, "Redmi Note 11" => {"Xiaomi", "smartphone", "Redmi Note 11"}, "Nokia G20" => {"Nokia", "smartphone", "G20"}, "Moto G Power" => {"Motorola", "smartphone", "Moto G Power"}}
APP_DEVICE_MODEL_REGEX = /Device\/([^\s;)]+)/i
APPLE_DEVICE_REGEX = /\b(iPhone|iPad|iPod)\b/i
HUAWEI_VENDOR_HINTS = /Huawei|Honor|HarmonyOS|OpenHarmony/i
MOBILE_HINTS = /Mobile|Mobi|Android|iPhone|iPad|iPod|Windows Phone|BlackBerry|BB10|Opera Mini|Opera Mobi|IEMobile|Kindle|Silk|webOS|Tizen|KaiOS|Maemo|MeeGo|Symbian|PlayBook|Tablet|Phone|MIDP|CLDC|Nokia|Samsung|SonyEricsson|HTC|Huawei/i

Constructors

new(user_agent : String)
Source

Class methods

huawei?(user_agent : String) : Bool

Returns true when the mobile vendor rules identify a Huawei model. Honor is evaluated first to preserve the ordering of the complete parser.

Source
huawei_regex_patterns

Returns the Huawei and Honor regular-expression sources used by .huawei?.

Source
prepare

Compiles every mobile vendor and model rule for parallel parsing.

Source
prepare_huawei

Compiles the Huawei and Honor parent/model rules used by .huawei?.

Source
regex_patterns

Returns every mobile vendor and model regular-expression source.

Source

Instance methods

android_model_shortcut
Source
call
Source
detect_mobile(vendor, device, detected_device)
Source
kind
Source
mobile_entries
Source
mobile_index
Source
mobiles
Source

Nested types