Skip to content

Instantly share code, notes, and snippets.

@andrewroth
Created January 21, 2009 06:04
Show Gist options
  • Save andrewroth/49871 to your computer and use it in GitHub Desktop.
Save andrewroth/49871 to your computer and use it in GitHub Desktop.
+ def self.doesnt_implement_attributes(atts)
+ for at, val in atts
+ val = "''" if val.class == String && val.empty?
+ self.class_eval "def #{at}() #{val}; end"
+ self.class_eval "def #{at}=(val) throw '#{at}=(val) is not implemented' end"
+ end
+ end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment