dlite922
dlite922

Reputation: 1994

ruby configatron foreach, How to display the name of a config?

I want to see test and test2

configatron.providers.test.remote_dir = '/incoming/test/current'
configatron.providers.test.local_dir = 'data/test'
configatron.providers.test2.remote_dir = '/incoming/test2/current'
configatron.providers.test2.local_dir = 'data/test2'


configatron.providers.foreach do |p| 
    p.name() #<--- how to display test/test2
end

Tried reading the manual? did I miss this somewhere? Google was no help.

Thanks.

Upvotes: 0

Views: 193

Answers (1)

phoet
phoet

Reputation: 18835

i guess this is what you are looking for:

configatron.providers.configatron_keys.map { |key| configatron.providers.send(key).local_dir }

Upvotes: 0

Related Questions