Sha256: 70ae05753aeb8b476b4c369cc5141292432ad3fe1283b33d9fdd879f0a50c76b

Contents?: true

Size: 547 Bytes

Versions: 6

Compression:

Stored size: 547 Bytes

Contents

module OpenTox

  # Ruby interface

  # create default OpenTox classes (defined in opentox-client.rb)
  # provides Mongoid's query and persistence methods
  # http://mongoid.org/en/mongoid/docs/persistence.html
  # http://mongoid.org/en/mongoid/docs/querying.html
  CLASSES.each do |klass|
    c = Class.new do
      include OpenTox
      include Mongoid::Document
      include Mongoid::Timestamps
      store_in collection: klass.downcase.pluralize
      field :title, as: :name,  type: String

    end
    OpenTox.const_set klass,c
  end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
lazar-0.0.7 lib/opentox.rb
lazar-0.0.6 lib/opentox.rb
lazar-0.0.5 lib/opentox.rb
lazar-0.0.4 lib/opentox.rb
lazar-0.0.3 lib/opentox.rb
lazar-0.0.1 lib/opentox.rb