Hi,

sorry if this has been discussed before (in this case please point me in
the right direction :). I am wondering if there is a mechanism in Ruby to
get something as C# does with its attributes. In C# attributes are a way
to tag namespaces, classes, methods etc. with metadata which can be quite
usefull in combination with reflection.

exmpl:

 ...
 [SomeFancyAttribute(EvenMoreFancyValue)]
 public int GetValue()
 {
  ...
 }

This would associate the attribute SomeFancyAttribute with its value
EvenMoreFancyValue with (to?) the method GetValue. Later this information
could be retrieved via reflection and used for whatsoever.

Is there a way to achieve something comparable with ruby?


Thanks for your thoughts! 


Cheers,

Steph.