Not really sure how to start asking this question so here's some code.
def find_attendees_by_attribute(attribute, criteria)
attribute = attribute.to_sym
if is_accepted_attribute?(attribute)
@attendee_list.each do |attendee|
#How do I get attendee."attribute" here?
end
else
puts "Sorry, not a good attribute."
end
end
def is_accepted_attribute?(attempted_attribute)
@attribute_list.include?(attempted_attribute)
end
So in the above code I have an Attendee class that has been pushed into the @attendee_list of this AttendeeList class. I'm only doing exact match search for now, I will add case-insensitive and whitespace removal after I get a basic functionality.
I want to have the entered attribute evaluated so that I can get that property from the attendees that are being searched in the block. Let me know if this isn't clear, I obviously lack the terminology of what I'm trying to do.