remogatto ha scritto:
> Hi all,
>
> maybe I'm missing something but I can't find a way to get an array
> containing the properties' names of the resource without traversing
> the Resource::properties array. Actually, to get what I want I have to
> do something like this:
>
> prop_names = properties.collect { |prop| prop.name }
>
> What I'm missing?
>
> Thanks in advance.
> Andrea
>
Ok, I must assume that the only way to fetch properties names is using
collect. So, would be convenient to add a properties_names method to
DataMapper::Resource::ClassMethods?
def properties_names(repository_name = default_repository_name)
properties[repository_name].collect { |property| property.name }
end
Regards,
Andrea
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"DataMapper" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/datamapper?hl=en
-~----------~----~----~----~------~----~------~--~---