Class: Imagga::CoreClient
- Inherits:
-
Object
- Object
- Imagga::CoreClient
- Includes:
- Exceptions
- Defined in:
- lib/imagga/core_client.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#api_key ⇒ Object
readonly
Returns the value of attribute api_key.
-
#api_secret ⇒ Object
readonly
Returns the value of attribute api_secret.
-
#base_uri ⇒ Object
readonly
Returns the value of attribute base_uri.
Instance Method Summary collapse
- #crop(options = {}) ⇒ Object
- #extract(options = {}) ⇒ Object
-
#initialize(opts = {}) ⇒ CoreClient
constructor
A new instance of CoreClient.
- #rank(options = {}) ⇒ Object
Methods included from Exceptions
#raise_if_request_failed!, #raise_missing
Constructor Details
#initialize(opts = {}) ⇒ CoreClient
Returns a new instance of CoreClient.
6 7 8 9 10 |
# File 'lib/imagga/core_client.rb', line 6 def initialize(opts={}) @api_key = opts[:api_key] || raise_missing(:api_key) @api_secret = opts[:api_secret] || raise_missing(:api_secret) @base_uri = opts[:base_uri] || raise_missing(:base_uri) end |
Instance Attribute Details
#api_key ⇒ Object (readonly)
Returns the value of attribute api_key.
4 5 6 |
# File 'lib/imagga/core_client.rb', line 4 def api_key @api_key end |
#api_secret ⇒ Object (readonly)
Returns the value of attribute api_secret.
4 5 6 |
# File 'lib/imagga/core_client.rb', line 4 def api_secret @api_secret end |
#base_uri ⇒ Object (readonly)
Returns the value of attribute base_uri.
4 5 6 |
# File 'lib/imagga/core_client.rb', line 4 def base_uri @base_uri end |
Instance Method Details
#crop(options = {}) ⇒ Object
20 21 22 |
# File 'lib/imagga/core_client.rb', line 20 def crop(={}) CropCommand.new(api_key, api_secret, base_uri).execute() end |
#extract(options = {}) ⇒ Object
12 13 14 |
# File 'lib/imagga/core_client.rb', line 12 def extract(={}) ExtractCommand.new(api_key, api_secret, base_uri).execute() end |
#rank(options = {}) ⇒ Object
16 17 18 |
# File 'lib/imagga/core_client.rb', line 16 def rank(={}) RankCommand.new(api_key, api_secret, base_uri).execute() end |