Class: Mindee::V2::Product::Crop::Params::CropParameters
- Inherits:
-
Input::BaseParameters
- Object
- Input::BaseParameters
- Mindee::V2::Product::Crop::Params::CropParameters
- Defined in:
- lib/mindee/v2/product/crop/params/crop_parameters.rb
Overview
Parameters accepted by the crop utility v2 endpoint.
Instance Attribute Summary
Attributes inherited from Input::BaseParameters
#close_file, #file_alias, #model_id, #polling_options, #webhook_ids
Class Method Summary collapse
-
.from_hash(params: {}) ⇒ CropParameters
Loads the parameters from a Hash.
-
.slug ⇒ String
Slug for the endpoint.
Instance Method Summary collapse
-
#initialize(model_id, file_alias: nil, webhook_ids: nil, polling_options: nil, close_file: true) ⇒ CropParameters
constructor
A new instance of CropParameters.
Methods inherited from Input::BaseParameters
#append_form_data, load_from_hash, #slug, #validate_async_params
Constructor Details
#initialize(model_id, file_alias: nil, webhook_ids: nil, polling_options: nil, close_file: true) ⇒ CropParameters
Returns a new instance of CropParameters.
21 22 23 24 25 26 27 28 29 |
# File 'lib/mindee/v2/product/crop/params/crop_parameters.rb', line 21 def initialize( model_id, file_alias: nil, webhook_ids: nil, polling_options: nil, close_file: true ) super end |
Class Method Details
.from_hash(params: {}) ⇒ CropParameters
Loads the parameters from a Hash.
34 35 36 37 38 39 40 41 |
# File 'lib/mindee/v2/product/crop/params/crop_parameters.rb', line 34 def self.from_hash(params: {}) CropParameters.new( params.fetch(:model_id), file_alias: params.fetch(:file_alias, nil), webhook_ids: params.fetch(:webhook_ids, nil), close_file: params.fetch(:close_file, true) ) end |
.slug ⇒ String
Returns Slug for the endpoint.
12 13 14 |
# File 'lib/mindee/v2/product/crop/params/crop_parameters.rb', line 12 def self.slug 'crop' end |