Class: Imagga::Client
- Inherits:
-
CoreClient
- Object
- CoreClient
- Imagga::Client
- Defined in:
- lib/imagga/client.rb
Instance Attribute Summary
Attributes inherited from CoreClient
#api_key, #api_secret, #base_uri
Instance Method Summary collapse
- #crop(urls_or_images, options = {}) ⇒ Object
- #extract(urls_or_images, options = {}) ⇒ Object
- #rank(options = {}) ⇒ Object
Methods inherited from CoreClient
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, ={}) .merge!(ImageOrUrlParametizer.new.build_urls(urls_or_images)) .merge!(ResolutionParametizer.new.parametrize(.fetch(:resolutions))) CropResultBuilder.new.build_from(super()) end |
#extract(urls_or_images, options = {}) ⇒ Object
3 4 5 6 |
# File 'lib/imagga/client.rb', line 3 def extract(urls_or_images, ={}) .merge!(ImageOrUrlParametizer.new.parametrize(urls_or_images)) ExtractResultBuilder.new.build_from(super()) end |
#rank(options = {}) ⇒ Object
8 9 10 11 12 |
# File 'lib/imagga/client.rb', line 8 def rank(={}) colors = .delete(:colors) { raise_missing('colors') } .merge!(RankColorParametizer.new.parametrize(colors)) RankResultBuilder.new.build_from(super()) end |