Class: CognitiveVision::ImageFeatures
- Inherits:
-
Object
- Object
- CognitiveVision::ImageFeatures
- Defined in:
- lib/cognitive_vision/image_features.rb
Constant Summary collapse
- ANALYZERS =
{ adult: ImageFeature::Adult.new, categories: ImageFeature::Category.new, description: ImageFeature::Description.new, faces: ImageFeature::Face.new, tags: ImageFeature::Tag.new }
Instance Method Summary collapse
- #analyzers ⇒ Object
- #features_string ⇒ Object
-
#initialize(features) ⇒ ImageFeatures
constructor
A new instance of ImageFeatures.
Constructor Details
#initialize(features) ⇒ ImageFeatures
Returns a new instance of ImageFeatures.
11 12 13 |
# File 'lib/cognitive_vision/image_features.rb', line 11 def initialize(features) @features = [features].flatten end |
Instance Method Details
#analyzers ⇒ Object
19 20 21 |
# File 'lib/cognitive_vision/image_features.rb', line 19 def analyzers ANALYZERS.map{ |feature, analyzer| analyzer if @features.include?(feature) }.reject(&:nil?) end |
#features_string ⇒ Object
15 16 17 |
# File 'lib/cognitive_vision/image_features.rb', line 15 def features_string @features.join(',') end |