[Nitro] Building objects from Strings

TRANS transfire at gmail.com
Wed Aug 9 06:48:32 EDT 2006


On 8/9/06, gabriele renzi <surrender_it at yahoo.it> wrote:
> TRANS ha scritto:
>
> >>A better solution could be using YAML.load on the given String.
> >>Someone has other ideas or could point me to something in facets (i.e.
> >>core/kernel/parse_literal) ?
> >
> >
> > Try:
> >
> >   YAML.load( "--ruby/object:#{type} {}" )
>
> mh.. I assume there is #{value} missing somewhere there?

  val = value.to_yaml.sub('---','')
  YAML.load( "--ruby/object:#{type} #{val}" )

Doesn't work though. YAML's not consistant it seems.

T.


More information about the Nitro-general mailing list