Serialize out of the
               Cerealize Box
           a drop-in replacement for ActiveRecord's serialize




cblue....
class Cat < ActiveRecord::Base

  serialize :can, Hash
end

 cblue.tw
Cat.create(:can =>
            {:food => ‘fish’,
             :mood => ‘dish’})


 cblue.tw
YAML
           is a human friendly
           data serialization



cblue.tw
YAML
           is not a machine friendly
           data serialization



cblue.tw
YAML
      SLOW for machine




cblue.tw
to the rescue
cblue.tw
class Cat < ActiveRecord::Base

  serialize :can, Hash
end

 cblue.tw
class Cat < ActiveRecord::Base
  include Cerealize
  serialize :can, Hash
end

 cblue.tw
class Cat < ActiveRecord::Base
  include Cerealize
  cerealize :can, Hash
end

 cblue.tw
cblue.tw
SAVED!!




cblue.tw
YAML
Marshal    Encoding JSON


cblue.tw
AUTO   detection
           YAML
  Encoding
Marshal
             JSON


cblue.tw
AUTO   detection
             YAML
  Encoding
Marshal
               JSON
conversion
cblue.tw   AUTO
class Cat < ActiveRecord::Base
  include Cerealize
  cerealize :can, Hash,
    :encoding => :marshal
end

 cblue.tw
class Cat < ActiveRecord::Base
  include Cerealize
  cerealize :can, Hash,
    :encoding => :yaml
end

 cblue.tw
class Cat < ActiveRecord::Base
  include Cerealize
  cerealize :can, Hash,
    :encoding => :json #future
end

 cblue.tw
Try it Today!
gem install cerealize

cblue.tw
Try it Today!
 script/plugin install
git://github.com/cardinalblue/cerealize.git

  cblue.tw
Contribution
             WANTED!!
http://github.com/cardinalblue/cerealize

 cblue.tw
Upcoming SlideShare
Loading in...5
×

2010 04-24-cerealize

718

Published on

0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
718
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
4
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

2010 04-24-cerealize

  1. 1. Serialize out of the Cerealize Box a drop-in replacement for ActiveRecord's serialize cblue.tw
  2. 2. class Cat < ActiveRecord::Base serialize :can, Hash end cblue.tw
  3. 3. Cat.create(:can => {:food => ‘fish’, :mood => ‘dish’}) cblue.tw
  4. 4. YAML is a human friendly data serialization cblue.tw
  5. 5. YAML is not a machine friendly data serialization cblue.tw
  6. 6. YAML SLOW for machine cblue.tw
  7. 7. to the rescue cblue.tw
  8. 8. class Cat < ActiveRecord::Base serialize :can, Hash end cblue.tw
  9. 9. class Cat < ActiveRecord::Base include Cerealize serialize :can, Hash end cblue.tw
  10. 10. class Cat < ActiveRecord::Base include Cerealize cerealize :can, Hash end cblue.tw
  11. 11. cblue.tw
  12. 12. SAVED!! cblue.tw
  13. 13. YAML Marshal Encoding JSON cblue.tw
  14. 14. AUTO detection YAML Encoding Marshal JSON cblue.tw
  15. 15. AUTO detection YAML Encoding Marshal JSON conversion cblue.tw AUTO
  16. 16. class Cat < ActiveRecord::Base include Cerealize cerealize :can, Hash, :encoding => :marshal end cblue.tw
  17. 17. class Cat < ActiveRecord::Base include Cerealize cerealize :can, Hash, :encoding => :yaml end cblue.tw
  18. 18. class Cat < ActiveRecord::Base include Cerealize cerealize :can, Hash, :encoding => :json #future end cblue.tw
  19. 19. Try it Today! gem install cerealize cblue.tw
  20. 20. Try it Today! script/plugin install git://github.com/cardinalblue/cerealize.git cblue.tw
  21. 21. Contribution WANTED!! http://github.com/cardinalblue/cerealize cblue.tw
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×