infochimps/icss — Issue #14: Icss serialization fails for to_yaml with 'anonymous class' 
Author: dsnyder90
Created: 2011-10-19 19:15:10+00:00
State: open

**Flip branch**

>> p = Icss::Meta::Protocol.receive(YAML.load(File.read("../infochimps_explorer/catalog/datasets/geo/location/geonames/places.icss.yaml")))
=> ##], responseIcss::Geo::GeonamesPlace, samples[#1000, "latitude"=>30.3, "longitude"=>-97.75, "zoom_level"=>9, "tile_x"=>23, "tile_y"=>58, "address_text"=>"1214 W 6th St. Suite 202 Austin, TX 78703", "bbox"=>"30.2,-97.85,30.4,-97.65", "q"=>"park"}], message#[]}, response_referencenesstrue, protocol#}, data_assets[], code_assets[], targets{}, extra_params{}, validation_contextnil, errors{}
>> p.to_hash.to_yaml
TypeError: can't dump anonymous class Class
from /Users/dsnyder/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/syck/rubytypes.rb:6:in `to_yaml'

This fails due to the presence of raw klasses like `Icss::Geo::Place` which cannot be serialized. I guess the lib should not serialize out the `is_a` associations once the fields have already been substituted in, or klasses should be converted back to their downcase string form, i.e. `geo.place`.