Skip to content

Instantly share code, notes, and snippets.

@dbrady
Created January 19, 2011 19:42
Show Gist options
  • Save dbrady/786710 to your computer and use it in GitHub Desktop.
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