lib/librato/config.rb in librato-0.0.5 vs lib/librato/config.rb in librato-0.0.6
- old
+ new
@@ -10,12 +10,18 @@
(options[:spaces] || data['spaces'] || []).map do |space|
space.is_a?(Hash) ? space : { 'name' => space }
end
end
+ def account(name)
+ accounts.find { |account| account['name'] == name }
+ end
+
def accounts
(data['accounts'] || {}).map do |name, account|
- env(name).merge(account).tap { |account| validate(account, name) }
+ env(name).merge(account).merge('name' => name).tap do |account|
+ validate(account, name)
+ end
end
end
private