Created
February 24, 2019 19:15
-
-
Save voidstar0/56673f184843e41ba5365c6ce3c8ce0f to your computer and use it in GitHub Desktop.
Ruby User Snippets for VSC
This file contains 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
{ | |
"Create class": { | |
"prefix": "cla", | |
"body": ["class ${1:ClassName}\n", "\tdef initialize", "\tend", "end"], | |
"description": "Create a class" | |
}, | |
"Create module": { | |
"prefix": "mod", | |
"body": ["module ${1:ModuleName}\n", "end"], | |
"description": "Create a module" | |
}, | |
"Create method": { | |
"prefix": "mtd", | |
"body": ["def ${1:method}", "\t", "end"], | |
"description": "Create a method" | |
}, | |
"Create getter": { | |
"prefix": "get", | |
"body": ["attr_reader :${1:attrib}"], | |
"description": "Create a getter attribute" | |
}, | |
"Create setter": { | |
"prefix": "set", | |
"body": ["attr_writer :${1:attrib}"], | |
"description": "Create a setter attribute" | |
}, | |
"Create getter+setter": { | |
"prefix": "acc", | |
"body": ["attr_accessor :${1:attrib}"], | |
"description": "Create a getter+setter attribute" | |
}, | |
"Create initializer": { | |
"prefix": "init", | |
"body": ["def initialize", "\t", "end"], | |
"description": "Create an initialize method" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment