add render method
This commit is contained in:
parent
6d9e32bb12
commit
72607c7f25
4 changed files with 22 additions and 0 deletions
|
@ -12,6 +12,9 @@ unit class PlaceholderPost does Post is json(:pretty);
|
|||
#| cheaty way
|
||||
has Bool:D $.placeholder = True;
|
||||
|
||||
#| An optional body for the placeholder post
|
||||
has Str $.body;
|
||||
|
||||
method title(--> Str:D) {
|
||||
"Placeholder Article"
|
||||
}
|
||||
|
@ -30,3 +33,8 @@ method empty(--> PlaceholderPost:D) {
|
|||
method all-slugs(--> Array[Str:D]) {
|
||||
Array[Str:D].new
|
||||
}
|
||||
|
||||
# Return the body if there is one, the empty string if there isn't one
|
||||
method render-html(--> Str:D) {
|
||||
$!body // ''
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue