ftlabs / fruitmachine

View rendering engine
MIT License
247 stars 18 forks source link

module.toJSON() doesn't return JSON :) #55

Closed georgecrawford closed 10 years ago

georgecrawford commented 10 years ago

Suggest a rename to module.serialize().

wilsonpage commented 10 years ago

This is following backbone convention:

model.toJSON();
matthew-andrews commented 10 years ago

But the output isn't JSON, it's javascript objects - which is even weirder when this API convention is used in other languages - when the output is even less JSON'y...

georgecrawford commented 10 years ago

Incidentally, @matthew-andrews, I feel tempted to implement this as follows in the PHP port:

$module->serialize(); // returns associative array
$module->toJSON(); // returns JSON-encoded serialization
matthew-andrews commented 10 years ago

Even though it is misleading it's consistent with other libs... Maybe it's ok...