Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'froggs-master'

Conflicts:
	lib/Bailador/App.pm
  • Loading branch information...
commit 39b621fb7330d9dac9f8abbb958c6b875135387d 2 parents e6d3543 + f609d94
@tadzik authored
Showing with 5 additions and 4 deletions.
  1. +5 −4 lib/Bailador/App.pm
View
9 lib/Bailador/App.pm
@@ -4,14 +4,15 @@ use Bailador::Template::Mojo;
class Bailador::App {
has %.routes = { GET => [], 'POST' => [] };
- has $.location is rw;
+ my $_location;
has Bailador::Context $.context = Bailador::Context.new;
has Bailador::Template $!renderer = Bailador::Template::Mojo.new;
method request { $.context.request }
method response { $.context.response }
+ method location is rw { return-rw $_location }
method template(Str $tmpl, @params) {
- $!renderer.render(slurp("$!location/views/$tmpl"), @params);
+ $!renderer.render(slurp("$_location/views/$tmpl"), @params);
}
my $current = Bailador::App.new;
@@ -29,7 +30,7 @@ class Bailador::App {
}
method _find_route($meth, $uri) {
- for %.routes{$meth}.list -> $r {
+ for $current.routes{$meth}.list -> $r {
next unless $r;
if $uri ~~ $r.key {
return $r, $/;
@@ -39,6 +40,6 @@ class Bailador::App {
}
method add_route($meth, Pair $route) {
- %.routes{$meth}.push: $route;
+ $current.routes{$meth}.push: $route;
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.