From c03c9f8b886c0e8eca5a701c0ca941e05e0b6285 Mon Sep 17 00:00:00 2001 From: Eugen Wissner Date: Fri, 21 Nov 2025 22:20:10 +0100 Subject: Add pharo tiny blog --- .../TinyBlog-Components/TBPostComponent.class.st | 42 ++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 pharo-mooc/tiny-blog/src/TinyBlog-Components/TBPostComponent.class.st (limited to 'pharo-mooc/tiny-blog/src/TinyBlog-Components/TBPostComponent.class.st') 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 +] -- cgit v1.2.3