While Ruby is an incredibly user-friendly language, it’s not without its conundrums—one in particular: self. self is a Ruby reserved word, or a wor...
For further actions, you may consider blocking this person and/or reporting abuse
Love the
self.all
method! It's like self-made (get it?) version of the RailsModel.all
. Makes me wonder what the Rails implementation is like.Hello Andy! I just realized I didn't reply to this comment when I first published this post and I apologize for that. Since it's over a year later and I punched the post up a bit I'm curious to know:
1) What do you think of the "refactored" post?
2) What have you learned about
self
since your last comment?Please let me know if I have anything wrong or if there's anything you think I should add to this post!
For some reason I’ve always felt
self
to be quite intuitive even though I logically agree with all the weird things.I always had way more hangups with, say, JS’s
this
.I was just thinking about that today! I have very basic knowledge of JS and remember learning about
this
and not getting it at all. I'm hoping my understanding of Ruby'sself
with help when I get to JS'sthis
in the Flatiron curriculum.