Class: RemoveBg::Configuration
- Inherits:
-
Object
- Object
- RemoveBg::Configuration
- Defined in:
- lib/remove_bg/configuration.rb
Instance Attribute Summary collapse
-
#api_key ⇒ Object
Returns the value of attribute api_key.
-
#auto_upgrade_png_to_zip ⇒ Object
Returns the value of attribute auto_upgrade_png_to_zip.
-
#image_processor ⇒ Object
Returns the value of attribute image_processor.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#api_key ⇒ Object
Returns the value of attribute api_key.
7 8 9 |
# File 'lib/remove_bg/configuration.rb', line 7 def api_key @api_key end |
#auto_upgrade_png_to_zip ⇒ Object
Returns the value of attribute auto_upgrade_png_to_zip.
7 8 9 |
# File 'lib/remove_bg/configuration.rb', line 7 def auto_upgrade_png_to_zip @auto_upgrade_png_to_zip end |
#image_processor ⇒ Object
Returns the value of attribute image_processor.
7 8 9 |
# File 'lib/remove_bg/configuration.rb', line 7 def image_processor @image_processor end |
Class Method Details
.configuration ⇒ Object
9 10 11 12 13 14 15 16 |
# File 'lib/remove_bg/configuration.rb', line 9 def self.configuration @configuration ||= Configuration.new.tap do |config| config.image_processor = ImageComposer.detect_image_processor # Upgrade to ZIP where possible to save bandwith config.auto_upgrade_png_to_zip = true end end |
.reset ⇒ Object
18 19 20 |
# File 'lib/remove_bg/configuration.rb', line 18 def self.reset @configuration = nil end |
Instance Method Details
#can_process_images? ⇒ Boolean
22 23 24 |
# File 'lib/remove_bg/configuration.rb', line 22 def can_process_images? !image_processor.nil? end |