>
> More importantly the autogenerated code is a bit stupid
>
> TBPost >> title: anObject
> title := anObject
>
> this is stupid, so even for generated one I select the argument, press
> ctrl+t (or right click + suggestions) and select 'rename' ... and rename it
> into something meaningful like
1) write them by hand
annoying typing required
2) use Class refactorings (right click on class -> refactoring -> class
refactoring -> generate accessors; or ctrl+h+a)
this will ask you to choose for all attributes… good initially, but really
stupid if you are providing e.g. just getters (because
Code not tested but
#('title' 'text')
do: [:each |
| body |
body := String new streamContents:
[ :s |
s nextPutAll: each ; cr; tab;
nextPutAll: '^ ';
nextPutAll: each ;
Or even quicker with the shortcut CMD+H+A
Cheers, Cédrik
In the TinyBlog mini-project of the MOOC, we start by creating the model.
However, since I basically finished the exercises, I wanted to go one step
further and
ask you guys, what is the correct way _not_ to write all gettters / setters for
the fields.
TBPost >> title
^ title
TBPost >> titl