Last active
November 16, 2016 21:35
-
-
Save sandeepseshadri/3ab7e8fa840b27b32ec157e953406792 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Mainly for php developers trying to make sense of ruby syntax | |
1. def send_message ------> public function sendMessage | |
2. begin rescue end ---> try catch | |
3. to_s ---> to string | |
4. $! ---> get_last_error() | |
5. self.save! ---> just a convention notifying side effect | |
6. user.is_admin? --> convention notifying it returns a boolean | |
7. user.send_message ---> $user.sendMessage() - no need for () if there are no parameters | |
8. self.account_id ---> $this->account_id | |
9. user.do_something(self) ---> $user->doSomething($this) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment