Class: Imagga::Client

Inherits:
CoreClient show all
Defined in:
lib/imagga/client.rb

Instance Attribute Summary

Attributes inherited from CoreClient

#api_key, #api_secret, #base_uri

Instance Method Summary collapse

Methods inherited from CoreClient

#initialize

Methods included from Exceptions

#raise_if_request_failed!, #raise_missing

Constructor Details

This class inherits a constructor from Imagga::CoreClient

Instance Method Details

#crop(urls_or_images, options = {}) ⇒ Object



14
15
16
17
18
# File 'lib/imagga/client.rb', line 14

def crop(urls_or_images, options={})
  options.merge!(ImageOrUrlParametizer.new.build_urls(urls_or_images))
  options.merge!(ResolutionParametizer.new.parametrize(options.fetch(:resolutions)))
  CropResultBuilder.new.build_from(super(options))
end

#extract(urls_or_images, options = {}) ⇒ Object



3
4
5
6
# File 'lib/imagga/client.rb', line 3

def extract(urls_or_images, options={})
  options.merge!(ImageOrUrlParametizer.new.parametrize(urls_or_images))
  ExtractResultBuilder.new.build_from(super(options))
end

#rank(options = {}) ⇒ Object



8
9
10
11
12
# File 'lib/imagga/client.rb', line 8

def rank(options={})
  colors = options.delete(:colors) { raise_missing('colors') }
  options.merge!(RankColorParametizer.new.parametrize(colors))
  RankResultBuilder.new.build_from(super(options))
end