Valerio VALDEZ Paolini > Mobile-WURFL > Mobile::WURFL::Device

Download:
Mobile-WURFL-0.02.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  1
View/Report Bugs
Module Version: 0.01   Source  

NAME ^

Mobile::WURFL::Device - WURFL Device

SYNOPSIS ^

  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 
  }

DESCRIPTION ^

Instantiated by Mobile::WURFL, a Device lists the capabilities of a mobile telephone handset identified by a user agent string.

new

Accepts 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
                    }
  }
_attribute

accepts an attribute name and returns its value in the current Device; valid attributes are:

user_agent

User Agent string.

id

unique identifier.

actual_device_root

set to true if current Device is an actual device.

fall_back

the identifier of an other Device from which the current Device inherits other capabilities.

_list_attributes

returns the sorted list of available attributes.

_list_capabilities

returns the sorted list of available capabilites.

capability

accepts an capability name and returns its value in the current Device; refer to WURFL documentation for a list of valid capabilities.

AUTOLOAD

if an AUTOLOADed method matches one of the WURFL capabilities, it returns the corresponding value stored in the current Device (see capability method).

SEE ALSO ^

Mobile::WURFL http://wurfl.sourceforge.net

AUTHOR ^

Valerio VALDEZ Paolini <valdez@cpan.org>

COPYRIGHT AND LICENSE ^

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.

syntax highlighting: