Hello everyone, this is really urgent so ill be quick, here is some ruby
code that i know works:
require 'csv'
class Motorcycle
attr_reader :name, :weight
@@count = 0
def self.find (name)
found = nil
ObjectSpace.each_object(Motorcycle) { |o|
fo
Patrick Collins wrote in post #1035294:
>> Motrocicle.create
>
> I don't know if this helps, but I am pretty sure "Motrocicle.create"
> isn't what
> you intended to call.
>
> Also, I'd like to point out that:
>
>> def self.find (name)
>> found = nil
>> ObjectSpace.each_obj
no, that didn't work, but i found that i may be due to garbage collector
taking place before test starts, so the solution was to add a set called
instances and then in the initialize method put the following code line
"instances << self", this way my instances had a root, preventing the
garbage