Module: ConvertApi
- Defined in:
- lib/convert_api.rb,
lib/convert_api/task.rb,
lib/convert_api/client.rb,
lib/convert_api/errors.rb,
lib/convert_api/result.rb,
lib/convert_api/version.rb,
lib/convert_api/upload_io.rb,
lib/convert_api/file_param.rb,
lib/convert_api/result_file.rb,
lib/convert_api/configuration.rb,
lib/convert_api/format_detector.rb
Defined Under Namespace
Modules: FileParam
Classes: AuthenticationError, Client, ClientError, Configuration, ConnectionFailed, Error, FileNameError, FormatDetector, FormatError, Result, ResultFile, Task, TimeoutError, UploadIO
Constant Summary
collapse
- URI_REGEXP =
URI::regexp(%w(http https))
- DEFAULT_URL_FORMAT =
'url'
- VERSION =
'3.0.0'
Class Method Summary
collapse
Class Method Details
.client ⇒ Object
34
35
36
|
# File 'lib/convert_api.rb', line 34
def client
Thread.current[:convert_api_client] ||= Client.new
end
|
.config ⇒ Object
22
23
24
|
# File 'lib/convert_api.rb', line 22
def config
@config ||= Configuration.new
end
|
18
19
20
|
# File 'lib/convert_api.rb', line 18
def configure
yield(config)
end
|
.convert(to_format, params, from_format: nil, conversion_timeout: nil) ⇒ Object
26
27
28
|
# File 'lib/convert_api.rb', line 26
def convert(to_format, params, from_format: nil, conversion_timeout: nil)
Task.new(from_format, to_format, params, conversion_timeout: conversion_timeout).run
end
|
.user ⇒ Object
30
31
32
|
# File 'lib/convert_api.rb', line 30
def user
client.get('user')
end
|