diff options
| author | Eugen Wissner <belka@caraus.de> | 2025-11-21 22:20:10 +0100 |
|---|---|---|
| committer | Eugen Wissner <belka@caraus.de> | 2025-11-21 22:20:10 +0100 |
| commit | c03c9f8b886c0e8eca5a701c0ca941e05e0b6285 (patch) | |
| tree | 5f27293563caa042b182de97fe59b22e2cbd533a /pharo-mooc/tiny-blog/src/TinyBlog-Components/TBPostComponent.class.st | |
| parent | c0336dac8effb57c04221f23b72bff70170933c5 (diff) | |
| download | book-exercises-c03c9f8b886c0e8eca5a701c0ca941e05e0b6285.tar.gz | |
Add pharo tiny blog
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 +] |
