diff options
Diffstat (limited to 'lib/opentox.rb')
-rw-r--r-- | lib/opentox.rb | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/opentox.rb b/lib/opentox.rb index 186c87a..5c300cf 100644 --- a/lib/opentox.rb +++ b/lib/opentox.rb @@ -1,8 +1,6 @@ module OpenTox - # Ruby interface - - # create default OpenTox classes (defined in opentox-client.rb) + # create default OpenTox classes # provides Mongoid's query and persistence methods # http://mongoid.org/en/mongoid/docs/persistence.html # http://mongoid.org/en/mongoid/docs/querying.html @@ -13,10 +11,15 @@ module OpenTox include Mongoid::Timestamps store_in collection: klass.downcase.pluralize field :name, type: String + field :source, type: String field :warnings, type: Array, default: [] + + def warn warning + $logger.warn warning + warnings << warning + end end OpenTox.const_set klass,c end end - |