From: timsuth@... (Tim Sutherland) Date: 2005-03-30T20:19:45+09:00 Subject: Re: attr :? In article <20050329180034.GA4745@trico.localnet>, Luke Renn wrote: >What is the proper term for things like attr : and belongs_to >:, etc. How do you code them? I tried googling around, but >since I don't know what to call it, its a little tough. I looked at >the ActiveRecord code for a few minutes and it looks like they're just >class methods, but I don't understand how ruby interprets it i guess. They are simply methods. Parentheses for method calls are optional for Ruby. So attr :foo is the same as attr(:foo) :foo is a Symbol - similar to a String. You can also write attr('foo') ....since the 'attr' method takes either a Symbol or a String. If you don't know why Symbol exists (why we don't just use String all the time), search the archives of this list, and ask again if you're still not sure. (The rest of the reason is explained but other people in this thread: Ruby evaluates statements/expressions "as it sees them".)