Reputation: 2454
If I have an attribute:
default[:mycookbook][:attr_foo] = "foo"
can I refer to it in the same file, something like this:
default[:mycookbook][:attr_bar] = default[:mycookbook][:attr_foo]
Upvotes: 4
Views: 2965
Reputation: 2454
This is possible, however the correct sytax is:
default[:mycookbook][:attr_bar] = "#{default[:mycookbook][:attr_foo]}"
..essentially the attribute is wrapped with:
"#{}"
Upvotes: 1