diff options
Diffstat (limited to 'pharo-mooc/tiny-blog/src/TinyBlog-Components/TBPostComponent.class.st')
| -rw-r--r-- | pharo-mooc/tiny-blog/src/TinyBlog-Components/TBPostComponent.class.st | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/pharo-mooc/tiny-blog/src/TinyBlog-Components/TBPostComponent.class.st b/pharo-mooc/tiny-blog/src/TinyBlog-Components/TBPostComponent.class.st new file mode 100644 index 0000000..f534bf7 --- /dev/null +++ b/pharo-mooc/tiny-blog/src/TinyBlog-Components/TBPostComponent.class.st @@ -0,0 +1,42 @@ +Class { + #name : 'TBPostComponent', + #superclass : 'SBSComponent', + #instVars : [ + 'post' + ], + #category : 'TinyBlog-Components', + #package : 'TinyBlog-Components' +} + +{ #category : 'initialization' } +TBPostComponent >> date [ + ^ post date +] + +{ #category : 'initialization' } +TBPostComponent >> initialize [ + super initialize. + post := TBPost new +] + +{ #category : 'initialization' } +TBPostComponent >> post: aPost [ + post := aPost +] + +{ #category : 'initialization' } +TBPostComponent >> renderContentOn: html [ + html heading level: 2; with: self title. + html heading level: 6; with: self date. + html text: self text +] + +{ #category : 'initialization' } +TBPostComponent >> text [ + ^ post text +] + +{ #category : 'initialization' } +TBPostComponent >> title [ + ^ post title +] |
