Module: RemoveBg
- Defined in:
- lib/remove_bg.rb,
lib/remove_bg/api.rb,
lib/remove_bg/error.rb,
lib/remove_bg/result.rb,
lib/remove_bg/upload.rb,
lib/remove_bg/version.rb,
lib/remove_bg/api_client.rb,
lib/remove_bg/account_info.rb,
lib/remove_bg/configuration.rb,
lib/remove_bg/url_validator.rb,
lib/remove_bg/image_composer.rb,
lib/remove_bg/http_connection.rb,
lib/remove_bg/rate_limit_info.rb,
lib/remove_bg/request_options.rb,
lib/remove_bg/result_metadata.rb,
lib/remove_bg/composite_result.rb,
lib/remove_bg/base_request_options.rb
Defined Under Namespace
Modules: Api Classes: AccountInfo, ApiClient, BaseRequestOptions, ClientHttpError, CompositeResult, Configuration, Error, FileError, FileMissingError, FileOverwriteError, HttpConnection, HttpError, ImageComposer, InvalidUrlError, RateLimitError, RateLimitInfo, RequestOptions, Result, ResultMetadata, ServerHttpError, Upload, UrlValidator
Constant Summary collapse
- VERSION =
"2.0.6"
Class Method Summary collapse
-
.account_info(raw_options = {}) ⇒ RemoveBg::AccountInfo
Fetches account information for the globally configured API key, or a specific API key if provided.
-
.configure {|RemoveBg::Configuration| ... } ⇒ Object
Yields the global Remove.bg configuration.
-
.from_file(image_path, raw_options = {}) ⇒ RemoveBg::Result|RemoveBg::CompositeResult
Removes the background from an image on the local file system.
-
.from_url(image_url, raw_options = {}) ⇒ RemoveBg::Result|RemoveBg::CompositeResult
Removes the background from the image at the URL specified.
Class Method Details
.account_info(raw_options = {}) ⇒ RemoveBg::AccountInfo
Fetches account information for the globally configured API key, or a specific API key if provided
34 35 36 37 |
# File 'lib/remove_bg.rb', line 34 def self.account_info( = {}) = RemoveBg::BaseRequestOptions.new() ApiClient.new.account_info() end |
.configure {|RemoveBg::Configuration| ... } ⇒ Object
Yields the global Remove.bg configuration
41 42 43 |
# File 'lib/remove_bg.rb', line 41 def self.configure yield RemoveBg::Configuration.configuration end |
.from_file(image_path, raw_options = {}) ⇒ RemoveBg::Result|RemoveBg::CompositeResult
Removes the background from an image on the local file system
14 15 16 17 |
# File 'lib/remove_bg.rb', line 14 def self.from_file(image_path, = {}) = RemoveBg::RequestOptions.new() ApiClient.new.remove_from_file(image_path, ) end |
.from_url(image_url, raw_options = {}) ⇒ RemoveBg::Result|RemoveBg::CompositeResult
Removes the background from the image at the URL specified
24 25 26 27 |
# File 'lib/remove_bg.rb', line 24 def self.from_url(image_url, = {}) = RemoveBg::RequestOptions.new() ApiClient.new.remove_from_url(image_url, ) end |