A
Arfon Smith
Hi, sorry if this isn't phrased quite as it should be!
I want to have a generic 'find' method that can check to see if an
object's attribute is true or false.
Basically I want to pass the method name (param) to the list_by_param
method but this doesn't seem to be working (I get an undefined local
variable or method 'param' for main:Object) error.
def list_by_param(param)
puts "#{object.id}" if object.param == true
end
puts objects.list_by_param(param)
Any idea where I'm going wrong?
Thanks
I want to have a generic 'find' method that can check to see if an
object's attribute is true or false.
Basically I want to pass the method name (param) to the list_by_param
method but this doesn't seem to be working (I get an undefined local
variable or method 'param' for main:Object) error.
def list_by_param(param)
puts "#{object.id}" if object.param == true
end
puts objects.list_by_param(param)
Any idea where I'm going wrong?
Thanks