Class: Magento::Configuration
- Inherits:
-
Object
- Object
- Magento::Configuration
- Defined in:
- lib/magento/configuration.rb
Instance Attribute Summary collapse
-
#open_timeout ⇒ Object
Returns the value of attribute open_timeout.
-
#product_image ⇒ Object
Returns the value of attribute product_image.
-
#store ⇒ Object
Returns the value of attribute store.
-
#timeout ⇒ Object
Returns the value of attribute timeout.
-
#token ⇒ Object
Returns the value of attribute token.
-
#url ⇒ Object
Returns the value of attribute url.
Instance Method Summary collapse
- #copy_with(params = {}) ⇒ Object
-
#initialize(url: nil, token: nil, store: nil) ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize(url: nil, token: nil, store: nil) ⇒ Configuration
Returns a new instance of Configuration.
5 6 7 8 9 10 11 12 13 |
# File 'lib/magento/configuration.rb', line 5 def initialize(url: nil, token: nil, store: nil) self.url = url || ENV['MAGENTO_URL'] self.open_timeout = 30 self.timeout = 90 self.token = token || ENV['MAGENTO_TOKEN'] self.store = store || ENV['MAGENTO_STORE'] || :all self.product_image = ProductImageConfiguration.new end |
Instance Attribute Details
#open_timeout ⇒ Object
Returns the value of attribute open_timeout.
3 4 5 |
# File 'lib/magento/configuration.rb', line 3 def open_timeout @open_timeout end |
#product_image ⇒ Object
Returns the value of attribute product_image.
3 4 5 |
# File 'lib/magento/configuration.rb', line 3 def product_image @product_image end |
#store ⇒ Object
Returns the value of attribute store.
3 4 5 |
# File 'lib/magento/configuration.rb', line 3 def store @store end |
#timeout ⇒ Object
Returns the value of attribute timeout.
3 4 5 |
# File 'lib/magento/configuration.rb', line 3 def timeout @timeout end |
#token ⇒ Object
Returns the value of attribute token.
3 4 5 |
# File 'lib/magento/configuration.rb', line 3 def token @token end |
#url ⇒ Object
Returns the value of attribute url.
3 4 5 |
# File 'lib/magento/configuration.rb', line 3 def url @url end |
Instance Method Details
#copy_with(params = {}) ⇒ Object
15 16 17 18 19 |
# File 'lib/magento/configuration.rb', line 15 def copy_with(params = {}) clone.tap do |config| params.each { |key, value| config.send("#{key}=", value) } end end |