123456789101112131415161718192021222324252627282930313233 |
- package SugarTrail::Repo;
- # provide access to STM objects
- #
- # * load_stm()
-
- use strict;
- use warnings;
- use Carp;
- use helper;
-
- # initialize repo
- sub new {
- my $class = shift;
- my $args = { @_ };
- exists($args->{type}) or $args->{type} = 'SugarTrail::Repo::Filesystem';
- $class = $args->{type};
- #TODO: remove use fail
- use SugarTrail::Repo::Filesystem;
- return $class->new(%$args);
- }
-
- sub load_stm {
- my $self = shift;
- my $args = { @_ };
-
- my $stm = {};
- $stm->{text} = $self->load_text(stm => $args->{stm})
- or return;
-
- return bless $stm, 'SugarTrail::STM';
- }
-
- 1;
|