On Apr 2, 2:00 pm, Rick <[email protected]> wrote:
> On Apr 2, 11:59 am, Frederick Cheung <[email protected]>
> wrote:
>
> Hi Fred thnaks for your time.
>
> I thought that I had created a class method in the (phonecall class) .
> Do you mean in the array class? And how do I do that. Is it not
No. (well technically you could create methods on the Array class but
that would be messy).
you'd want something like
def self.total_cost(array_of_phone_calls)
...
end
and then PhoneCall.total_cost(some_array)
Fred
> possibl;e to create methods in the phonecall model file that act upon
> a collection(array) of that object or do they have to be acting only
> on a single instance of that object.
>
> Once again thanks for your time.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" 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/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---