Skip to content
Browse files

using lvalue method for accessing location

  • Loading branch information...
1 parent d6d1711 commit f609d94df00a2c3c4837775f18e384fef139d983 @FROGGS committed Aug 29, 2012
Showing with 3 additions and 2 deletions.
  1. +3 −2 lib/Bailador/App.pm
View
5 lib/Bailador/App.pm
@@ -4,14 +4,15 @@ use Template::Mojo;
class Bailador::App {
has %.routes = { GET => [], 'POST' => [] };
- has $.location is rw;
+ my $_location;
has Bailador::Context $.context = Bailador::Context.new;
has Template::Mojo $!template; # type object
method request { $.context.request }
method response { $.context.response }
+ method location is rw { return-rw $_location }
method template(Str $tmpl, @params) {
- $!template.new(slurp "$!location/views/$tmpl").render(|@params);
+ $!template.new(slurp "$_location/views/$tmpl").render(|@params);
}
my $current = Bailador::App.new;

0 comments on commit f609d94

Please sign in to comment.
Something went wrong with that request. Please try again.