$ rails g model User
belongs_to
has_one
| import re | |
| # Supported tokens and their operations | |
| ORDER_OF_OPERATIONS = ["MULTIPLY", "DIVIDE", "ADD", "SUBTRACT"] | |
| scanner = re.Scanner([ | |
| (r"([0-9]+)", lambda x, y: int(y)), | |
| (r"\+", lambda x, y: "ADD"), | |
| (r"-", lambda x, y: "SUBTRACT"), | |
| (r"\*", lambda x, y: "MULTIPLY"), | |
| (r"/", lambda x, y: "DIVIDE"), |
| /* | |
| * object.watch polyfill | |
| * | |
| * 2012-04-03 | |
| * | |
| * By Eli Grey, http://eligrey.com | |
| * Public Domain. | |
| * NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK. | |
| */ |