Class: Magento::Configuration

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

Constant Summary collapse

CONFIG_PATH =
File.dirname(__FILE__) + "/../config/magento.yml"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize {|_self| ... } ⇒ Configuration

Returns a new instance of Configuration.

Yields:

  • (_self)

Yield Parameters:

Raises:



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)
  options = YAML.load_file(CONFIG_PATH)
  @username = options["username"]
  @api_key  = options["api_key"]
  @host     = options["host"]
  @path     = options["path"]
  @port     = options["port"]
  yield self if block_given?
end

Instance Attribute Details

#api_keyObject

Returns the value of attribute api_key.



4
5
6
# File 'lib/configuration.rb', line 4

def api_key
  @api_key
end

#hostObject

Returns the value of attribute host.



4
5
6
# File 'lib/configuration.rb', line 4

def host
  @host
end

#pathObject

Returns the value of attribute path.



4
5
6
# File 'lib/configuration.rb', line 4

def path
  @path
end

#portObject

Returns the value of attribute port.



4
5
6
# File 'lib/configuration.rb', line 4

def port
  @port
end

#usernameObject

Returns the value of attribute username.



4
5
6
# File 'lib/configuration.rb', line 4

def username
  @username
end