Skip to content

Instantly share code, notes, and snippets.

@johndel
Created May 24, 2013 17:53
Show Gist options
  • Save johndel/5645288 to your computer and use it in GitHub Desktop.
Save johndel/5645288 to your computer and use it in GitHub Desktop.
Stefanos is losing
class Myclass
def initialize
@attributes = []
end
def method_missing(name, *args)
attribute = name.to_s
if attribute =~ /=$/
@attributes[attribute.chop] = args[0]
else
@attributes[attribute]
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment