summaryrefslogtreecommitdiff
path: root/lib/feature.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/feature.rb')
-rw-r--r--lib/feature.rb29
1 files changed, 11 insertions, 18 deletions
diff --git a/lib/feature.rb b/lib/feature.rb
index b58946b..0ca4d41 100644
--- a/lib/feature.rb
+++ b/lib/feature.rb
@@ -2,27 +2,28 @@ module OpenTox
# Basic feature class
class Feature
- field :nominal, type: Boolean
- field :numeric, type: Boolean
field :measured, type: Boolean
field :calculated, type: Boolean
+ field :category, type: String
+ field :unit, type: String
+ field :conditions, type: Hash
+
+ def nominal?
+ self.class == NominalFeature
+ end
+
+ def numeric?
+ self.class == NumericFeature
+ end
end
# Feature for categorical variables
class NominalFeature < Feature
field :accept_values, type: Array
- def initialize params
- super params
- nominal = true
- end
end
# Feature for quantitative variables
class NumericFeature < Feature
- def initialize params
- super params
- numeric = true
- end
end
# Feature for SMARTS fragments
@@ -34,12 +35,4 @@ module OpenTox
end
end
- # Feature for categorical bioassay results
- class NominalBioAssay < NominalFeature
- end
-
- # Feature for quantitative bioassay results
- class NumericBioAssay < NumericFeature
- end
-
end