summaryrefslogtreecommitdiff
path: root/lib/feature.rb
diff options
context:
space:
mode:
authorChristoph Helma <helma@in-silico.ch>2017-01-11 16:00:07 +0100
committerChristoph Helma <helma@in-silico.ch>2017-01-11 16:00:07 +0100
commit85553b339acf3f9285a1c03b2fff342d9ddb9b6b (patch)
treea00b5879578ed07ed2bea7b67c8da3896b43bc5d /lib/feature.rb
parentf522a1089af8775798450b3f9f0aa4b579a3e1b5 (diff)
documentation for all classes
Diffstat (limited to 'lib/feature.rb')
-rw-r--r--lib/feature.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/feature.rb b/lib/feature.rb
index 0ca4d41..f811aef 100644
--- a/lib/feature.rb
+++ b/lib/feature.rb
@@ -8,10 +8,14 @@ module OpenTox
field :unit, type: String
field :conditions, type: Hash
+ # Is it a nominal feature
+ # @return [TrueClass,FalseClass]
def nominal?
self.class == NominalFeature
end
+ # Is it a numeric feature
+ # @return [TrueClass,FalseClass]
def numeric?
self.class == NumericFeature
end
@@ -30,6 +34,9 @@ module OpenTox
class Smarts < NominalFeature
field :smarts, type: String
index "smarts" => 1
+ # Create feature from SMARTS string
+ # @param [String]
+ # @return [OpenTox::Feature]
def self.from_smarts smarts
self.find_or_create_by :smarts => smarts
end