I'm a Rubywan, so I'm still new to this. Any advice would be extremely helpful! Currently working on figuring out methods and hashes. I'm trying to access the Hash named school, but keep coming up with a NameError. More specifically, this is the error (followed by the method that's trying to access the Hash):
test.rb:19:in `student_grade': undefined local variable or method `school' for main:Object (NameError).
def student_grade(student_name)
student = school[:students].select do |student|
if student[:name] == student_name
student_grade = student[:grade]
puts student_grade
else
puts "Student doesn't exist!"
end
end
end