Is there any standard way of creating c# like attributes for ruby?
eg in c#
[RequireTransaction]
public void MyMethod()
...
which can later be examined via reflection and see what attribs are
available on each method.
if there is no standard way, would it be ok to make it like this?
meta :some_method => "BizMethod"
meta :some_method => "WritesData"
meta :some_method => "RequireTrans"
def some_method()
....
end
by making "meta" a method of Class , wich takes a value key pair
which can later be fetched by another Class method which takes a symbol
like :some_method
eg
attributes = MyType.get_attributes :some_method
or
res = MyType.has_attribute :some_method,"RequireTrans"
Im still too new to Ruby so I feel like mc guyver trying to invent
things and have no clue if they are ok or just stupid
//Roger
···
--
Posted via http://www.ruby-forum.com/.