Class: RemoveBg::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/remove_bg/configuration.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#api_keyObject

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_zipObject

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_processorObject

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

.configurationObject



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

.resetObject



18
19
20
# File 'lib/remove_bg/configuration.rb', line 18

def self.reset
  @configuration = nil
end

Instance Method Details

#can_process_images?Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/remove_bg/configuration.rb', line 22

def can_process_images?
  !image_processor.nil?
end