summaryrefslogtreecommitdiff
path: root/pharo-mooc/tiny-blog/src/TinyBlog-Components/TBPostComponent.class.st
blob: f534bf7bba050d99a66e8264f56ea775e47fcaa6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
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
]