<commit_before>= Typed Serialize

Typed serialize makes sure your serialized attribute is always the specified
type. This is especially nice for serialized hashes and new models.

== Example

  class User < ActiveRecord::Base
    typed_serialize :settings, Hash
  end

  User.new.settings        # => {}

  u = User.new
  u.settings[:theme] = 1
  u.settings               # => { :theme => 1 }

== Define serialized attributes

=== Avalaible only for Hash columns!!!

  class User < ActiveRecord::Base
    typed_serialize :settings, Hash

    serialized_accessor :settings, :photo, :city, :nickname

  end

  u = User.new
  u.photo = '/home/photos/me.png'
  u.photo
  => '/home/photos/me.png'
  u.settings
  =>{:photo=>'/home/photos/me.png'}

or even better

  class User < ActiveRecord::Base
    typed_serialize :settings, Hash, :photo, :city, :nickname

  end

  u = User.new(:city=>'NY')
  u.city
  => 'NY'

Also avalaible <b>serialized_reader</b> and <b>serialized_writer</b>.

== Install

As a Rails plugin:

  ./script/plugin install git://github.com/jqr/typed_serialize.git

Prefer gems? Add this to your environment.rb and run the following command.

  config.gem 'typed_serialize'

  $ rake gems:install


== Docs

http://rdoc.info/projects/jqr/typed_serialize

Homepage:: http://github.com/jqr/typed_serialize
License:: Copyright (c) 2008 <NAME> <mailto:<EMAIL>>, released under the MIT license<commit_msg>Adding recent contributors.<commit_after>= Typed Serialize

Typed serialize makes sure your serialized attribute is always the specified
type. This is especially nice for serialized hashes and new models.

== Example

  class User < ActiveRecord::Base
    typed_serialize :settings, Hash
  end

  User.new.settings        # => {}

  u = User.new
  u.settings[:theme] = 1
  u.settings               # => { :theme => 1 }

== Define serialized attributes

=== Avalaible only for Hash columns!!!

  class User < ActiveRecord::Base
    typed_serialize :settings, Hash

    serialized_accessor :settings, :photo, :city, :nickname

  end

  u = User.new
  u.photo = '/home/photos/me.png'
  u.photo
  => '/home/photos/me.png'
  u.settings
  =>{:photo=>'/home/photos/me.png'}

or even better

  class User < ActiveRecord::Base
    typed_serialize :settings, Hash, :photo, :city, :nickname

  end

  u = User.new(:city=>'NY')
  u.city
  => 'NY'

Also avalaible <b>serialized_reader</b> and <b>serialized_writer</b>.

== Install

As a Rails plugin:

  ./script/plugin install git://github.com/jqr/typed_serialize.git

Prefer gems? Add this to your environment.rb and run the following command.

  config.gem 'typed_serialize'

  $ rake gems:install


== Docs

http://rdoc.info/projects/jqr/typed_serialize

== Contributors

* <NAME> (<EMAIL>)
* <NAME> (<EMAIL>)

Homepage:: http://github.com/jqr/typed_serialize
License:: Copyright (c) 2008 <NAME> <mailto:<EMAIL>>, released under the MIT license
{'fraction_non_alphanumeric': 0.12655172413793103, 'fraction_numerical': 0.004137931034482759, 'mean_word_length': 3.561320754716981, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 37, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4684288', 'n_tokens_mistral': 992, 'n_tokens_neox': 934, 'n_words': 266}