Mobile::Libwurfl::Device - Device perl wrapper to wurfl_device_handle
(Perl bindings for the wurfl commercial library)
use Wurfl; $wurfl = Wurfl->new(PATH_TO_WURFL_XML_FILE); $device = $wurfl->lookup_useragent(USERAGENT); # or $device = $wurfl->get_device(DEVICE_ID); # get an hashref with all known capabilities $capabilities = $device->capabilities; # or access a specific capability directly $viewport_width = $device->get_capability('viewport_width');
Perl bindings to the commercial C library to access wurfl databases
new ($wurfl, $device)
Creates a new Device object. Both $wurfl and $device must be defined. $wurfl must point to a valid Wurfl object $device must be a valid wurfl_device_handle pointer returned by the underlying C API
capabilities
Rerturns an hashref with all the known capabilities applicable to the current device
id
Returns the id of the current device. The id can be used later with Mobile::Libwurfl::get_device() to obtain a new instance of this same device
useragent
Returns the default useragent string for the current device
get_capability ($capability)
Returns the value of the specific $capability (if it is a valid capability, undef otherwise)
has_capability ($capability)
Returns true if $capability is a valid capability applicable to the current device, undef otherwise
Note that this doesn't check the actual value of the capability (if boolean it can still be 'false') but it just checks the existance of $capability among the known capabilities
get_virtual_capability ($capability)
has_virtual_capability ($capability)
match_type ()
Returns the type of match for the current device. returned value can be any of :
WURFL_MATCH_TYPE_EXACT WURFL_MATCH_TYPE_CONCLUSIVE WURFL_MATCH_TYPE_RECOVERY WURFL_MATCH_TYPE_CATCHALL WURFL_MATCH_TYPE_HIGHPERFORMANCE WURFL_MATCH_TYPE_NONE WURFL_MATCH_TYPE_CACHED
Such constants are exported by the Wurfl. Check libwurfl documentation for more details about matcher types and strings
matcher_name ()
Returns the string identifying the 'matcher' which matched the current device
Check libwurfl documentation for more details about matcher types and strings
Mobile::Libwurfl
Andrea Guzzo, <xant@xant.net>
Copyright (C) 2013 by Andrea Guzzo
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.14.2 or, at your option, any later version of Perl 5 you may have available.
1 POD Error
The following errors were encountered while parsing the POD:
You forgot a '=back' before '=head1'
To install Mobile::Libwurfl, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Mobile::Libwurfl
CPAN shell
perl -MCPAN -e shell install Mobile::Libwurfl
For more information on module installation, please visit the detailed CPAN module installation guide.