Class: Archipel::Api::Internal::Config
- Inherits:
-
Object
- Object
- Archipel::Api::Internal::Config
- Defined in:
- lib/archipel/api/internal/config.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
Instance Method Summary collapse
- #[](entry) ⇒ Object
-
#initialize(name) ⇒ Config
constructor
A new instance of Config.
Constructor Details
#initialize(name) ⇒ Config
Returns a new instance of Config.
5 6 7 8 |
# File 'lib/archipel/api/internal/config.rb', line 5 def initialize name config_file = File.join Rails.root, 'config', "#{name}.yml" @config = YAML.load_file(config_file)[Rails.env].deep_symbolize_keys end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
2 3 4 |
# File 'lib/archipel/api/internal/config.rb', line 2 def config @config end |
Instance Method Details
#[](entry) ⇒ Object
10 11 12 |
# File 'lib/archipel/api/internal/config.rb', line 10 def [] entry @config[entry] end |