-
-
15 Jan 2005 16:18:50 UTC
- Distribution: WWW-Restaurant-Menu
- Module version: 0.11
- Source (raw)
- Browse (raw)
- Changes
- How to Contribute
- Issues
- Testers (32 / 1 / 338)
- Kwalitee
Bus factor: 0- 74.60% Coverage
- License: perl_5
- Perl: v5.800.0
- Activity
24 month- Tools
- Download (8.2KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
- Dependencies
- Encode
- LWP
- and possibly others
- Reverse dependencies
- CPAN Testers List
- Dependency graph
NAME
WWW::Restaurant::Menu - An abstract Perl base class for querying online menus of restaurants.
VERSION
0.11
SYNOPSIS
Online restaurant menu querying:
use WWW::Restaurant::Menu; # Construction: my $menu = WWW::Restaurant::Menu->new(%options); # Get all menu items, in order: my @items = $menu->items; # Get menu items by class: my @starters = $menu->starters; my @meals = $menu->meals; my @desserts = $menu->desserts; my @drinks = $menu->drinks; # Get currency of item prices: my $currency = $menu->currency;
Deriving new restaurant menu classes:
package WWW::Restaurant::<CC>::<City>::<Restaurant>::Menu[::<Submenu>]; # CC ISO 3166 "alpha 2" country code # <http://ftp.ics.uci.edu/pub/ietf/http/related/iso3166.txt>. # City Name of the city where the restaurant is located. # Restaurant Name of the restaurant (unique within that city, if possible). # Submenu A special menu, like "Breakfast", "Lunch", "HappyHour"... use base qw(WWW::Restaurant::Menu); sub currency { return "$some_currency"; # Return currency of item prices. } sub query { my ($self) = @_; # Populate $self->{items} with WWW::Restaurant::Menu::Item objects: ... return $self->{items}; }
DESCRIPTION
This is an abstract Perl base class for querying online menus of restaurants. It should be sub-classed for functionality specific to restaurants.
Constructor
The following constructor is provided:
- new(%options): RETURNS WWW::Restaurant::Menu
-
Creates a new
WWW::Restaurant::Menu
object from the given options. No options are supported by this base class.
Instance methods
The following instance methods are provided:
- items: RETURNS (WWW::Restaurant::Menu::Item, ...)
-
Returns a list of WWW::Restaurant::Menu::Item (or derivative) objects representing all the items on this menu, in the order they appear on the menu.
- starters: RETURNS (WWW::Restaurant::Menu::Item::Starter, ...)
- meals: RETURNS (WWW::Restaurant::Menu::Item::Meal, ...)
- desserts: RETURNS (WWW::Restaurant::Menu::Item::Dessert, ...)
- drinks: RETURNS (WWW::Restaurand::Menu::Item::Drink, ...)
-
Returns a list of objects representing the items of the requested class that are on this menu, in the order they appear on the menu.
- currency: RETURNS SCALAR
-
Returns a string denoting the currency of the item prices on the menu.
SEE ALSO
For COPYRIGHT and LICENSE information, see WWW::Restaurant::Menu::Overview.
AUTHOR
Julian Mehnle <julian@mehnle.net>
Module Install Instructions
To install WWW::Restaurant::Menu, copy and paste the appropriate command in to your terminal.
cpanm WWW::Restaurant::Menu
perl -MCPAN -e shell install WWW::Restaurant::Menu
For more information on module installation, please visit the detailed CPAN module installation guide.