Mobile::WURFL::Device - WURFL Device


Mobile-WURFL documentation  | view source Contained in the Mobile-WURFL distribution.

Index


NAME

Top

Mobile::WURFL::Device - WURFL Device

SYNOPSIS

Top

  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

Top

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

Top

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

AUTHOR

Top

Valerio VALDEZ Paolini <valdez@cpan.org>

COPYRIGHT AND LICENSE

Top


Mobile-WURFL documentation  | view source Contained in the Mobile-WURFL distribution.