Skip to content

Instantly share code, notes, and snippets.

@mboeh
Created March 19, 2012 21:55
Show Gist options
  • Save mboeh/2127450 to your computer and use it in GitHub Desktop.
Save mboeh/2127450 to your computer and use it in GitHub Desktop.
Single-argument #[]=
class Orz
attr_reader :v
def []=(v)
@v = v
end
end
orz = Orz.new
orz[] = :a
orz.v # ==> :a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment