DEV Community

Cover image for Get to Know Your Self (Refactored)

Get to Know Your Self (Refactored)

Meg Gutshall on September 20, 2018

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...
Collapse
 
andy profile image
Andy Zhao (he/him)

Love the self.all method! It's like self-made (get it?) version of the Rails Model.all. Makes me wonder what the Rails implementation is like.

Collapse
 
meg_gutshall profile image
Meg Gutshall

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!

Collapse
 
ben profile image
Ben Halpern

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.

Collapse
 
meg_gutshall profile image
Meg Gutshall

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's self with help when I get to JS's this in the Flatiron curriculum.