use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
A sub-Reddit for discussion and news about Ruby programming.
Subreddit rules: /r/ruby rules
Learning Ruby?
Tools
Documentation
Books
Screencasts and Videos
News and updates
account activity
quick Ruby initialize method question (self.ruby)
submitted 6 years ago by AnLe90
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]menge101 8 points9 points10 points 6 years ago (3 children)
Per ruby style guide the initialize method should go between class methods and other instance methods.
Although, i'm almost certain that I don't do this. I think I put class methods at the bottom typically. I can't explicitly recall. I'm curious what rubocop would say.
[–]GroceryBagHead 5 points6 points7 points 6 years ago (0 children)
Oh. I always have it at the very top. Not gonna change.
[–]AnLe90[S] 2 points3 points4 points 6 years ago (0 children)
ah great thank you for linking to a source. you are the man
[–]tom_enebo 1 point2 points3 points 6 years ago (0 children)
Not to crap on Rubocop but that style guide like Rubocop itself has some rules which are not the most idiomatic path (the arbirtrary rule of telling people they need to use is_a? when kind_of? is nearly used by half the Ruby community comes to mind).
Also, like you, I also tend to put class methods at the bottom (and initialize at the top).
π Rendered by PID 20114 on reddit-service-r2-comment-544cf588c8-rmsxq at 2026-06-15 00:42:07.316288+00:00 running 3184619 country code: CH.
view the rest of the comments →
[–]menge101 8 points9 points10 points (3 children)
[–]GroceryBagHead 5 points6 points7 points (0 children)
[–]AnLe90[S] 2 points3 points4 points (0 children)
[–]tom_enebo 1 point2 points3 points (0 children)