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




cblue.tw
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

More Related Content

ODP
Nigel hamilton-megameet-2013
PDF
JavaScript OOP Pattern
PDF
Php assíncrono com_react_php
PDF
Advanced fun with Objective-C runtime.
PDF
Lies, Damn Lies, and Benchmarks
PDF
Memory Manglement in Raku
PDF
BASH Variables Part 1: Basic Interpolation
PDF
BSDM with BASH: Command Interpolation
Nigel hamilton-megameet-2013
JavaScript OOP Pattern
Php assíncrono com_react_php
Advanced fun with Objective-C runtime.
Lies, Damn Lies, and Benchmarks
Memory Manglement in Raku
BASH Variables Part 1: Basic Interpolation
BSDM with BASH: Command Interpolation

What's hot (20)

PDF
5 kinesis lightning
PDF
Nick Sieger JRuby Concurrency EMRubyConf 2011
PDF
Extracting ruby gem
PDF
State management in a GraphQL era
PDF
Unit Testing Lots of Perl
KEY
Mojo as a_client
KEY
CoffeeScript: JavaScript, but Better!
PDF
Object Trampoline: Why having not the object you want is what you need.
PDF
Metadata-driven Testing
PDF
I, For One, Welcome Our New Perl6 Overlords
PDF
JRuby @ Boulder Ruby
PDF
Keeping objects healthy with Object::Exercise.
PDF
The $path to knowledge: What little it take to unit-test Perl.
ZIP
Web Apps in Perl - HTTP 101
PDF
Effective Benchmarks
PDF
Getting testy with Perl
PDF
Perl web frameworks
PPT
Going crazy with Node.JS and CakePHP
PPTX
Troubleshooting Puppet
ODP
Presentation of JSConf.eu
5 kinesis lightning
Nick Sieger JRuby Concurrency EMRubyConf 2011
Extracting ruby gem
State management in a GraphQL era
Unit Testing Lots of Perl
Mojo as a_client
CoffeeScript: JavaScript, but Better!
Object Trampoline: Why having not the object you want is what you need.
Metadata-driven Testing
I, For One, Welcome Our New Perl6 Overlords
JRuby @ Boulder Ruby
Keeping objects healthy with Object::Exercise.
The $path to knowledge: What little it take to unit-test Perl.
Web Apps in Perl - HTTP 101
Effective Benchmarks
Getting testy with Perl
Perl web frameworks
Going crazy with Node.JS and CakePHP
Troubleshooting Puppet
Presentation of JSConf.eu
Ad

Viewers also liked (9)

PDF
2008-12-21 Rubinius
PDF
Concurrent Ruby Application Servers
PDF
The Architecture of PicCollage Server
PDF
Server Development Workflow For PicCollage
PDF
2012 05-08-lambda-draft
PDF
2007-06-24 The Lost Piece
PDF
2008-01-25 Tangible Value
PDF
2010-04-13 Reactor Pattern & Event Driven Programming 2
PDF
2010-02-09 Reactor Pattern & Event Driven Programming
2008-12-21 Rubinius
Concurrent Ruby Application Servers
The Architecture of PicCollage Server
Server Development Workflow For PicCollage
2012 05-08-lambda-draft
2007-06-24 The Lost Piece
2008-01-25 Tangible Value
2010-04-13 Reactor Pattern & Event Driven Programming 2
2010-02-09 Reactor Pattern & Event Driven Programming
Ad

2010 04-24-cerealize

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