Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ziyan-junaideen/d89c3b7c2a4fb04ab05ff2454f1878b1 to your computer and use it in GitHub Desktop.
Save ziyan-junaideen/d89c3b7c2a4fb04ab05ff2454f1878b1 to your computer and use it in GitHub Desktop.
Scripting within a VSCode Snippet
def initialize(${1})
<split ${1} by comma and for each split>
@{split} = #{split}
<end>
end
# So that some thing like this `def initialize(a, b)` would result
def initialize(a, b)
@a = a
@b = b
end
# and for `def initialize(a, b, c)` would result
def initialize(a, b)
@a = a
@b = b
@c = c
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment