Class: Archipel::Api::Internal::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/archipel/api/internal/config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#configObject (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