I have the following class with the following method(s):
class Ad
def generate
# Find logo
@logo = create_logo(arg1,arg2...)
end
def create_logo(arg1,arg2,..)
#Logic that sets @logo
return @logo
end
end
So, as you can see I am using an @instance_variable as return values and receiving values of methods. I believe that by doing so, methods are more testable and somehow it makes the code clear, but do you think this is correct in Ruby?
Or this would be more correct:
class Ad
def generate
# Find logo
create_logo(arg1,arg2...)
end
def create_logo(arg1,arg2,..)
#Logic that sets @logo
end
end
Thanks