From d4d73cd5eefc56f9ea47627e73e06045d03bbfbc Mon Sep 17 00:00:00 2001 From: Peter Hart Date: Tue, 9 Feb 2021 08:54:49 -0500 Subject: [PATCH] Initial TBPost --- src/TinyBlog/TBPost.class.st | 74 ++++++++++++++++++++++++++++++++++++ src/TinyBlog/package.st | 1 + 2 files changed, 75 insertions(+) create mode 100644 src/TinyBlog/TBPost.class.st create mode 100644 src/TinyBlog/package.st diff --git a/src/TinyBlog/TBPost.class.st b/src/TinyBlog/TBPost.class.st new file mode 100644 index 0000000..4ca8281 --- /dev/null +++ b/src/TinyBlog/TBPost.class.st @@ -0,0 +1,74 @@ +Class { + #name : #TBPost, + #superclass : #Object, + #instVars : [ + 'title', + 'text', + 'date', + 'category', + 'visible' + ], + #category : #TinyBlog +} + +{ #category : #action } +TBPost >> beVisible [ + "Makes the post visible" + self visible: true +] + +{ #category : #accessing } +TBPost >> category [ + ^ category +] + +{ #category : #accessing } +TBPost >> category: anObject [ + category := anObject +] + +{ #category : #accessing } +TBPost >> date [ + ^ date +] + +{ #category : #accessing } +TBPost >> date: anObject [ + date := anObject +] + +{ #category : #action } +TBPost >> notVisible [ + "Makes the instance no longer visisble" + self visible: false +] + +{ #category : #accessing } +TBPost >> text [ + ^ text +] + +{ #category : #accessing } +TBPost >> text: anObject [ + text := anObject +] + +{ #category : #accessing } +TBPost >> title [ + ^ title +] + +{ #category : #accessing } +TBPost >> title: anObject [ + title := anObject +] + +{ #category : #accessing } +TBPost >> visible [ + ^ visible +] + +{ #category : #accessing } +TBPost >> visible: anObject [ + visible := anObject +] diff --git a/src/TinyBlog/package.st b/src/TinyBlog/package.st new file mode 100644 index 0000000..79182b2 --- /dev/null +++ b/src/TinyBlog/package.st @@ -0,0 +1 @@ +Package { #name : #TinyBlog }