From: Trans Date: 2005-10-31T23:57:06+09:00 Subject: Re: C# attributes in Ruby? Zach Dennis wrote: > Ok, still wrapping my head around this... Is the following a correct > assumption? > > You would use: > class MyObject > ann :type => :browsable > ... > end I think you mean to annotate the class itself, yes? Then... class MyObject ann self, :type => :browsable ... end or (works only in latest as-of-yet unreleased version) class MyObject annotation :type => :browsable ... end > Over something like? > class CandyBar > attr_reader :browseable? > ... > end Yes. > Now perhaps I am missing something, so another question. During the > lifetime of your object, would it's annotations change? So it may be > browsable at one time during it's life, but then later on say the > :type=>:browsable would be removed? Yes. MyObject.annotation.type = nil Not sure there's a clean way to delete an annoation yet, I will add that. Thanks. > Since you see annotations as so useful, I am just trying to make sure I > see where the usefullness is, in case it is something I find would > benefit my own code. That is why I ask so many questions. No problem. If you have any suggestions for improvement please suggest. T.