| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package MealMaster::Recipe; |
|
2
|
1
|
|
|
1
|
|
5
|
use strict; |
|
|
1
|
|
|
|
|
1
|
|
|
|
1
|
|
|
|
|
36
|
|
|
3
|
1
|
|
|
1
|
|
5
|
use base qw(Class::Accessor::Chained::Fast); |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
842
|
|
|
4
|
|
|
|
|
|
|
__PACKAGE__->mk_accessors(qw(title categories yield ingredients directions)); |
|
5
|
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
1; |
|
7
|
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
=head1 NAME |
|
9
|
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
MealMaster::Recipe - Represent a MealMaster Recipe |
|
11
|
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
=head1 SYNOPSIS |
|
13
|
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
foreach my $r (@recipes) { |
|
15
|
|
|
|
|
|
|
print "Title: " . $r->title . "\n"; |
|
16
|
|
|
|
|
|
|
print "Categories: " . join(", ", sort @{$r->categories}) . "\n"; |
|
17
|
|
|
|
|
|
|
print "Yield: " . $r->yield . "\n"; |
|
18
|
|
|
|
|
|
|
print "Directions: " . $r->directions . "\n"; |
|
19
|
|
|
|
|
|
|
print "Ingredients:\n"; |
|
20
|
|
|
|
|
|
|
foreach my $i (@{$r->ingredients}) { |
|
21
|
|
|
|
|
|
|
print " " . $i->quantity . |
|
22
|
|
|
|
|
|
|
" " . $i->measure . |
|
23
|
|
|
|
|
|
|
" " . $i->product . |
|
24
|
|
|
|
|
|
|
"\n"; |
|
25
|
|
|
|
|
|
|
} |
|
26
|
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
=head1 DESCRIPTION |
|
28
|
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
L represents a MealMaster recipe. |
|
30
|
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
=head1 METHODS |
|
32
|
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=head2 categories |
|
34
|
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
Returns an array reference of the categories that the recipe is filed |
|
36
|
|
|
|
|
|
|
under: |
|
37
|
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
print "Categories: " . join(", ", sort @{$r->categories}) . "\n"; |
|
39
|
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=head2 directions |
|
41
|
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
Returns the directions for making the recipe: |
|
43
|
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
print "Directions: " . $r->directions . "\n"; |
|
45
|
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
=head2 ingredients |
|
47
|
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
Returns a list of ingredients for making the recipe: |
|
49
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
print "Ingredients:\n"; |
|
51
|
|
|
|
|
|
|
foreach my $i (@{$r->ingredients}) { |
|
52
|
|
|
|
|
|
|
print " " . $i->quantity . |
|
53
|
|
|
|
|
|
|
" " . $i->measure . |
|
54
|
|
|
|
|
|
|
" " . $i->product . |
|
55
|
|
|
|
|
|
|
"\n"; |
|
56
|
|
|
|
|
|
|
} |
|
57
|
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=head2 title |
|
59
|
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
Returns the title of the recipe: |
|
61
|
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
print "Title: " . $r->title . "\n"; |
|
63
|
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
Returns the yield of the recipe: |
|
65
|
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
print "Yield: " . $r->yield . "\n"; |
|
67
|
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
=head1 SEE ALSO |
|
69
|
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
L, L |
|
71
|
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
=head1 AUTHOR |
|
73
|
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
Leon Brocard, C<< >> |
|
75
|
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
=head1 COPYRIGHT |
|
77
|
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
Copyright (C) 2005, Leon Brocard |
|
79
|
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
This module is free software; you can redistribute it or modify it |
|
81
|
|
|
|
|
|
|
under the same terms as Perl itself. |