diff --git a/lib/uploadcare/client/conversion/base_conversion_client.rb b/lib/uploadcare/client/conversion/base_conversion_client.rb index 868a0cf..4e0f666 100644 --- a/lib/uploadcare/client/conversion/base_conversion_client.rb +++ b/lib/uploadcare/client/conversion/base_conversion_client.rb @@ -37,9 +37,9 @@ def extract_result(response_body) parsed_body = JSON.parse(response_body, symbolize_names: true) errors = parsed_body[:error] || parsed_body[:problems] - return Dry::Monads::Failure(errors) unless errors.nil? || errors.empty? + return Dry::Monads::Result::Failure.call(errors) unless errors.nil? || errors.empty? - Dry::Monads::Success(parsed_body) + Dry::Monads::Result::Success.call(parsed_body) end # Prepares body for convert_many method diff --git a/lib/uploadcare/client/rest_group_client.rb b/lib/uploadcare/client/rest_group_client.rb index 396b1b4..c407a0f 100644 --- a/lib/uploadcare/client/rest_group_client.rb +++ b/lib/uploadcare/client/rest_group_client.rb @@ -17,7 +17,7 @@ def store(uuid) end end - Dry::Monads::Success(nil) + Dry::Monads::Result::Success.call(nil) end # Get a file group by its ID. diff --git a/lib/uploadcare/client/uploader_client.rb b/lib/uploadcare/client/uploader_client.rb index e7a7424..76f5e5d 100644 --- a/lib/uploadcare/client/uploader_client.rb +++ b/lib/uploadcare/client/uploader_client.rb @@ -42,7 +42,7 @@ def upload_from_url(url, options = {}) uploaded_response = poll_upload_response(token_response.success[:token]) return uploaded_response if uploaded_response.success[:status] == 'error' - Dry::Monads::Success(files: [uploaded_response.success]) + Dry::Monads::Result::Success.call(files: [uploaded_response.success]) end # Check upload status