Frederick Ros wrote : | Me bummer ! BaseEntry::maker just adds the method to_html to relevant | String object ... but using yaml_as we do not call anymore | BaseEntry::maker ...
OK... Here are my latest thoughts on this:
- AFAIR in 1.8.2 the only way to add custom types to YAML was to use
the add_domain_type together with you domain and type name, and a
block that is responsible for creating the needed object from a hash
read in the YAML file
- Beginning with 1.8.3, we now have the yaml_as method to handle
custom type 'magically'... that means no block to furnish
Unfortunately, in our case, the BaseEntry and derived types have fields
that are String objects *but* that should be able to evaluate themself
into html string, using the text processor the user choices (usually
RedCloth but can be any other)... So when using the add_domain_type
we're able to build singleton String object with a to_html method when
convenient ... but if we do use the yaml_as the read objects have String
fields ....
So IMHO we should resort *only* to add_domain_type in the code, and
remove the call to yaml_as when it's available (that is in Ruby 1.8.3)
...
Before doing this change I'd like to know if somebody think it's OK ???
--
Frederick Ros aka Sleeper -- [EMAIL PROTECTED]
Use the good features of a language; avoid the bad ones.
- The Elements of Programming Style (Kernighan & Plaugher)
pgpfzpOeDXVHT.pgp
Description: PGP signature
_______________________________________________ Hobix-is-the-way mailing list [email protected] http://rubyforge.org/mailman/listinfo/hobix-is-the-way
