can someone explain why do you need an instance method find to loop and find the record when the looping can be done in the class method? Wouldn't you be able to something like attached below?
class << self
def find(id)
return unless id
new(USERS.find { |user| user[:id] == id })
end
end
☒ You really don't need the instance methods in that example, It can be done at the class level. If I were to go back and redo this episode, I would leave any class level qualifying methods out of instance level methods.
find
to loop and find the record when the looping can be done in the class method? Wouldn't you be able to something like attached below?