package SugarTrail::Repo; # provide access to STM objects # # * load_stm() use strict; use warnings; use Carp; use helper; use SugarTrail::STM; # 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 = SugarTrail::STM->new(); $stm->{text} = $self->load_text(stm => $args->{stm}) or return; $stm->{stm} = $args->{stm}; return $stm; } 1;