diff options
author | Christoph Helma <helma@in-silico.ch> | 2015-10-08 10:43:43 +0200 |
---|---|---|
committer | Christoph Helma <helma@in-silico.ch> | 2015-10-08 10:43:43 +0200 |
commit | 1a56148aadef031c4f487bc23fda43f4ac5b7369 (patch) | |
tree | 3555c5883ed0c292b105c40c185ebba3e5bd4e3e /lib/opentox.rb | |
parent | 394d564699756288569169ff3e198d6d7702f092 (diff) | |
parent | e3217075b602a950a0ee995fcfa731d97b5ba3eb (diff) |
new master branch
Diffstat (limited to 'lib/opentox.rb')
-rw-r--r-- | lib/opentox.rb | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/lib/opentox.rb b/lib/opentox.rb new file mode 100644 index 0000000..186c87a --- /dev/null +++ b/lib/opentox.rb @@ -0,0 +1,22 @@ +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 :name, type: String + field :warnings, type: Array, default: [] + end + OpenTox.const_set klass,c + end + +end + |