require 'configuration'
b = Configuration.for('b'){
host "codeforpeople.com"
www {
port 80
url "http://#{ host }:#{ port }"
}
db {
port 5342
url "db://#{ host }:#{ port }"
}
mail {
host "gmail.com"
port 25
url "mail://#{ host }:#{ port }"
}
}
c = Configuration.for('c' ,b){
foo 'bar'
}
puts b.mail.url
puts c.mail.url
outputs
mail://gmail.com:25
test.rb:28:in `<main>': undefined method `url' for {:host=>"gmail.com", :port=>25, :url=>"mail://gmail.com:25"}:Hash (NoMethodError)
outputs