Skip to content

Instantly share code, notes, and snippets.

@dbrady
Created January 19, 2011 19:42
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save dbrady/786710 to your computer and use it in GitHub Desktop.
# One pattern I use so much I need to make an editor macro for it:
class Foo
attr_accessor :x, :y, :z, :w
# --> macro on above line should produce:
def initialize(x, y, z, w)
@x, @y, @z, @w = x, y, z, w
end
# --> end macro
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment