| 1 | package File::Feed::Context; | ||
| 2 | |||
| 3 | use strict; | ||
| 4 | use warnings; | ||
| 5 | |||
| 6 | use String::Expando; | ||
| 7 | |||
| 8 | sub new { | ||
| 9 | my $cls = shift; | ||
| 10 | bless { | ||
| 11 | 'stash' => { @_ }, | ||
| 12 | 'expando' => String::Expando->new, | ||
| 13 | }, $cls; | ||
| 14 | } | ||
| 15 | |||
| 16 | sub expand { | ||
| 17 | my ($self, $str) = @_; | ||
| 18 | return $self->{'expando'}->expand($str, $self->{'stash'}); | ||
| 19 | } | ||
| 20 | |||
| 21 | 1; |