The manakai project

Web::Transport::PlatformInfo

Defaults of platform-dependent configurations

SYNOPSIS

  use Web::Transport::PlatformInfo;
  $info = Web::Transport::PlatformInfo->new_default;
  $info_mobile = Web::Transport::PlatformInfo->new_mobile;
  warn $info->user_agent;
  warn $info_mobile->user_agent;

DESCRIPTION

The Web::Transport::PlatformInfo class is a typical implementation of the underlying platform information object (See "UNDERLYING PLATFORM INFORMATION OBJECT" in Web::Transport).

METHODS

There are following methods:

$info = Web::Transport::PlatformInfo->new_default

Create and return a default platform information object.

$info = Web::Transport::PlatformInfo->new_mobile

Create and return a default platform information object for mobile browsers.

$info = Web::Transport::PlatformInfo->new_nonbrowser

Create and return a default platform information object for "non-browser" browsers. (In general this method should not be used. The new_default method is more appropriate for most user agents, including non-browser user agents.)

$info = Web::Transport::PlatformInfo->new_from_device_os_navigator ($device, $os, $navigator)

Create and return a platform information object.

The first argument is the device type, i.e. desktop (desktop browsers), tablet (tablet browsers), mobile (smartphone browsers), or nonbrowser (user agents incompatible with browsers). The second argument is the OS, i.e. windows, mac, ios, or linux. The third argument is the navigator compatibility mode, i.e. chrome, webkit, or gecko.

If the arguments are invalid comabinations of values, an exception is thrown.

AUTHOR

Wakaba <wakaba@suikawiki.org>.

LICENSE

Copyright 2018-2019 Wakaba <wakaba@suikawiki.org>.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.