The @ syntax is preferred, variables will not always be available as ruby methods:
http://docs.puppetlabs.com/guides/templating.html#referencing-variables