Class: Messed::Configuration
- Inherits:
-
Object
- Object
- Messed::Configuration
- Includes:
- ConfigHelper
- Defined in:
- lib/messed/configuration.rb
Defined Under Namespace
Modules: ConfigHelper Classes: Application, Interfaces, Queues
Instance Attribute Summary collapse
-
#application ⇒ Object
readonly
Returns the value of attribute application.
-
#environment ⇒ Object
readonly
Returns the value of attribute environment.
-
#environments ⇒ Object
readonly
Returns the value of attribute environments.
-
#interfaces ⇒ Object
readonly
Returns the value of attribute interfaces.
-
#log_level ⇒ Object
Returns the value of attribute log_level.
-
#logger ⇒ Object
Returns the value of attribute logger.
-
#queues ⇒ Object
readonly
Returns the value of attribute queues.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(environments, environment) ⇒ Configuration
constructor
A new instance of Configuration.
Methods included from ConfigHelper
Constructor Details
#initialize(environments, environment) ⇒ Configuration
Returns a new instance of Configuration.
85 86 87 88 89 90 |
# File 'lib/messed/configuration.rb', line 85 def initialize(environments, environment) @environments, @environment = environments, environment @queues = Queues.new @interfaces = Interfaces.new @application = Application.new end |
Instance Attribute Details
#application ⇒ Object (readonly)
Returns the value of attribute application.
82 83 84 |
# File 'lib/messed/configuration.rb', line 82 def application @application end |
#environment ⇒ Object (readonly)
Returns the value of attribute environment.
82 83 84 |
# File 'lib/messed/configuration.rb', line 82 def environment @environment end |
#environments ⇒ Object (readonly)
Returns the value of attribute environments.
82 83 84 |
# File 'lib/messed/configuration.rb', line 82 def environments @environments end |
#interfaces ⇒ Object (readonly)
Returns the value of attribute interfaces.
82 83 84 |
# File 'lib/messed/configuration.rb', line 82 def interfaces @interfaces end |
#log_level ⇒ Object
Returns the value of attribute log_level.
83 84 85 |
# File 'lib/messed/configuration.rb', line 83 def log_level @log_level end |
#logger ⇒ Object
Returns the value of attribute logger.
83 84 85 |
# File 'lib/messed/configuration.rb', line 83 def logger @logger end |
#queues ⇒ Object (readonly)
Returns the value of attribute queues.
82 83 84 |
# File 'lib/messed/configuration.rb', line 82 def queues @queues end |
Class Method Details
.load_from_directory(environment, dir) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/messed/configuration.rb', line 12 def self.load_from_directory(environment, dir) environments = [] Dir[File.join(dir, '*')].each do |file| environments << file if File.directory?(file) end instance = new(environments, environment) instance.instance_eval(File.read(File.join(dir, 'environment.rb')), File.join(dir, 'environment.rb'), 1) instance.instance_eval(File.read(File.join(dir, 'environments', "#{environment}.rb")), File.join(dir, 'environments', "#{environment}.rb"), 1) instance end |