Skip to content

Instantly share code, notes, and snippets.

@voidstar0
Created February 24, 2019 19:15
Show Gist options
  • Save voidstar0/56673f184843e41ba5365c6ce3c8ce0f to your computer and use it in GitHub Desktop.
Save voidstar0/56673f184843e41ba5365c6ce3c8ce0f to your computer and use it in GitHub Desktop.
Ruby User Snippets for VSC
{
"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