Class: Magento::Configuration
- Inherits:
-
Object
- Object
- Magento::Configuration
- Defined in:
- lib/configuration.rb
Constant Summary collapse
- CONFIG_PATH =
File.dirname(__FILE__) + "/../config/magento.yml"
Instance Attribute Summary collapse
-
#api_key ⇒ Object
Returns the value of attribute api_key.
-
#host ⇒ Object
Returns the value of attribute host.
-
#path ⇒ Object
Returns the value of attribute path.
-
#port ⇒ Object
Returns the value of attribute port.
-
#username ⇒ Object
Returns the value of attribute username.
Instance Method Summary collapse
-
#initialize {|_self| ... } ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize {|_self| ... } ⇒ Configuration
Returns a new instance of Configuration.
8 9 10 11 12 13 14 15 16 17 |
# File 'lib/configuration.rb', line 8 def initialize raise ConfigurationException, "Missing configuration file" unless File.exists?(CONFIG_PATH) = YAML.load_file(CONFIG_PATH) @username = ["username"] @api_key = ["api_key"] @host = ["host"] @path = ["path"] @port = ["port"] yield self if block_given? end |
Instance Attribute Details
#api_key ⇒ Object
Returns the value of attribute api_key.
4 5 6 |
# File 'lib/configuration.rb', line 4 def api_key @api_key end |
#host ⇒ Object
Returns the value of attribute host.
4 5 6 |
# File 'lib/configuration.rb', line 4 def host @host end |
#path ⇒ Object
Returns the value of attribute path.
4 5 6 |
# File 'lib/configuration.rb', line 4 def path @path end |
#port ⇒ Object
Returns the value of attribute port.
4 5 6 |
# File 'lib/configuration.rb', line 4 def port @port end |
#username ⇒ Object
Returns the value of attribute username.
4 5 6 |
# File 'lib/configuration.rb', line 4 def username @username end |