Module: Multitagger
- Defined in:
- lib/multitagger.rb,
lib/multitagger/tag.rb,
lib/multitagger/config.rb,
lib/multitagger/version.rb,
lib/multitagger/provider/google.rb,
lib/multitagger/provider/imagga.rb,
lib/multitagger/provider/clarifai.rb,
lib/multitagger/provider/microsoft.rb,
lib/multitagger/provider/algorithmia.rb
Defined Under Namespace
Modules: Provider
Classes: Config, Tag
Constant Summary
collapse
- VERSION =
"0.1.0"
Class Method Summary
collapse
Class Method Details
.providers ⇒ Object
14
15
16
|
# File 'lib/multitagger.rb', line 14
def self.providers
Provider.constants.select { |c| Provider.const_get(c).is_a? Class }.map(&:downcase)
end
|
.tag(provider, image) ⇒ Object
18
19
20
|
# File 'lib/multitagger.rb', line 18
def self.tag(provider, image)
self.tagger(provider).tag(image)
end
|
.tagger(provider, config = nil) ⇒ Object
8
9
10
11
12
|
# File 'lib/multitagger.rb', line 8
def self.tagger(provider, config = nil)
clazz = Provider.const_get(provider.to_s.capitalize)
config ||= Config.read[provider.to_s]
clazz.new(config)
end
|