| Mobile-WURFL documentation | view source | Contained in the Mobile-WURFL distribution. |
Mobile::WURFL::Device - WURFL Device
use Mobile::WURFL::Device;
my $device = Mobile::WURFL::Device->new({ device_data => $hashref });
my $ua_string = $device->_attribute('user_agent');
if ($device->gif eq 'true') {
# do something
}
Instantiated by Mobile::WURFL, a Device lists the capabilities of a mobile telephone handset identified by a user agent string.
newAccepts a hash reference, a key named device_data can be used to feed data to object constructor; data should be a reference to a structure like this:
{ attributes => { attribute => value,
other => value
},
capabilities => { attribute => value,
other => value
}
}
_attributeaccepts an attribute name and returns its value in the current Device; valid attributes are:
user_agentUser Agent string.
idunique identifier.
actual_device_rootset to true if current Device is an actual device.
fall_backthe identifier of an other Device from which the current Device inherits other capabilities.
_list_attributesreturns the sorted list of available attributes.
_list_capabilitiesreturns the sorted list of available capabilites.
capabilityaccepts an capability name and returns its value in the current Device; refer to WURFL documentation for a list of valid capabilities.
AUTOLOADif an AUTOLOADed method matches one of the WURFL capabilities, it returns the
corresponding value stored in the current Device (see capability method).
Valerio VALDEZ Paolini <valdez@cpan.org>
Copyright (C) 2005 by Valerio VALDEZ Paolini <valdez@cpan.org>
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.4 or, at your option, any later version of Perl 5 you may have available.
| Mobile-WURFL documentation | view source | Contained in the Mobile-WURFL distribution. |