<commit_before>Ohm ॐ
=====

Object-hash mapping library for Redis.

Description
-----------

Ohm is a library that allows to store an object in
[Redis](http://code.google.com/p/redis/), a persistent key-value
database. It includes an extensible list of validations and has very
good performance.

Usage
-----

    require 'ohm'

    Ohm.connect

    class Event < Ohm::Model
      attribute :name
      set :participants
      list :comments

      def validate
        assert_present :name
      end
    end

    event = Event.create(:name => "Ruby Tuesday")
    event.participants << "<NAME>"
    event.participants << "<NAME>"
    event.participants      #=> ["<NAME>", "<NAME>"]

    event.comments << "Very interesting event!"
    event.comments << "Agree"
    event.comments          #=> ["Very interesting event!", "Agree"]

    another_event = Event.new
    another_event.valid?    #=> false
    another_event.errors    #=> [[:name, :nil]]

    another_event.name = ""
    another_event.valid?    #=> false
    another_event.errors    #=> [[:name, :empty]]

    another_event.name = "Ruby Lunch"
    another_event.create    #=> true

Installation
------------
<commit_msg>Changed README to reflect the new syntax for collections<commit_after>Ohm ॐ
=====

Object-hash mapping library for Redis.

Description
-----------

Ohm is a library that allows to store an object in
[Redis](http://code.google.com/p/redis/), a persistent key-value
database. It includes an extensible list of validations and has very
good performance.

Usage
-----

    require 'ohm'

    Ohm.connect

    class Event < Ohm::Model
      attribute :name
      set :participants
      list :comments

      index :name

      def validate
        assert_present :name
      end
    end

    event = Event.create(:name => "Ruby Tuesday")
    event.participants << "<NAME>"
    event.participants << "<NAME>"
    event.participants.all #=> ["<NAME>", "<NAME>"]

    event.comments << "Very interesting event!"
    event.comments << "Agree"
    event.comments.all #=> ["Very interesting event!", "Agree"]

    another_event = Event.new
    another_event.valid?    #=> false
    another_event.errors    #=> [[:name, :nil]]

    another_event.name = ""
    another_event.valid?    #=> false
    another_event.errors    #=> [[:name, :empty]]

    another_event.name = "<NAME>"
    another_event.create    #=> true

Installation
------------

{'fraction_non_alphanumeric': 0.14386401326699835, 'fraction_numerical': 0.0, 'mean_word_length': 2.6176911544227885, 'pattern_counts': {'":': 0, '<': 30, '<?xml version=': 0, '>': 28, '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': '4576056', 'n_tokens_mistral': 742, 'n_tokens_neox': 704, 'n_words': 201}