Best way to make an attribute always an array?
- by Shadowfirebird
I'm using my MOO project to teach myself Test Driven Design, and it's taking me interesting places. For example, I wrote a test that said an attribute on a particular object should always return an array, so --
t = Thing.new("test")
p t.names #-> ["test"]
t.names = nil
p t.names #-> []
The code I have for this is okay, but it doesn't…