| 1 | package Pegex::Drinkup::Data; | ||||||||||
| 2 | 2 | ▶ | use Pegex::Base; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | 2 | extends 'Pegex::Tree'; | |||||||||
| 4 | |||||||||||
| 5 | 2 | my $data; | |||||||||
| 6 | |||||||||||
| 7 | 1 | ▶ | sub initial { | ||||||||
|
Subroutine
initial: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 8 | 1 | $data = {}; | |||||||||
| 9 | } | ||||||||||
| 10 | |||||||||||
| 11 | 1 | ▶ | sub got_cocktail { | ||||||||
|
Subroutine
got_cocktail: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 12 | 1 | $data->{name} = $_[1]; | |||||||||
| 13 | } | ||||||||||
| 14 | |||||||||||
| 15 | 1 | ▶ | sub got_description { | ||||||||
|
Subroutine
got_description: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 16 | 1 | $data->{description} = $_[1]; | |||||||||
| 17 | } | ||||||||||
| 18 | |||||||||||
| 19 | 1 | ▶ | sub got_instructions { | ||||||||
|
Subroutine
got_instructions: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 20 | 1 | $data->{instructions} = $_[1]; | |||||||||
| 21 | } | ||||||||||
| 22 | |||||||||||
| 23 | 1 | ▶ | sub got_ingredients { | ||||||||
|
Subroutine
got_ingredients: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||
| 24 | $data->{ingredients} = [ | ||||||||||
| 25 | map { | ||||||||||
| 26 | 4 | my $ingredient = { | |||||||||
| 27 | amount => 0 + $_->[0], | ||||||||||
| 28 | unit => $_->[1], | ||||||||||
| 29 | ingredient => $_->[2], | ||||||||||
| 30 | }; | ||||||||||
| 31 | 4 | ▶ | $ingredient->{note} = $_->[3] if $_->[3]; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 32 | 4 | $ingredient; | |||||||||
| 33 | 1 | } @{$_[1]} | |||||||||
| 34 | ]; | ||||||||||
| 35 | } | ||||||||||
| 36 | |||||||||||
| 37 | 1 | ▶ | sub got_metadata { | ||||||||
|
Subroutine
got_metadata: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 38 | 1 | $data->{lc $_[1]->[0]} = $_[1]->[1] | |||||||||
| 39 | } | ||||||||||
| 40 | |||||||||||
| 41 | 1 | ▶ | sub final { | ||||||||
|
Subroutine
final: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 42 | 1 | return $data; | |||||||||
| 43 | } | ||||||||||
| 44 | |||||||||||
| 45 | 2 | 1; | |||||||||