I want to write a method that generate a method that when I execute
this recreates the objects that I STONified.
(I love STON).

So I did something like that

descriptionMethodFrom: descriptionItems
"self new descriptionMethodFrom: ChrysalConfigurationDescription

  ^ String streamContents: [ :s |
            s nextPutAll: 'descriptions'; cr.
            s nextPutAll: '^ STON fromString: '.
            s nextPutAll: (STON toStringPretty: descriptionItems) ]

and I get of course something wrong :) because the strings are not
doubel quoted and the first expression is not surrounded by single

And I could do it but I want a smart way to do it. I was thinking that
may be I'm missing something obvious.

^ STON fromString: [
StringConfigurationItem {
#propertyName : 'title',
#default : 'my super cool book'
BooleanConfigurationItem {
#propertyName : 'verbose',
#default : 'true'
StringConfigurationItem {
#propertyName : 'attribution',
#default : 'me, myself and I'
StringConfigurationItem {
#propertyName : 'series',
#default : 'Square Bracket Associate Collection'

Reply via email to