Skip to content

Instantly share code, notes, and snippets.

@jamesgolick
Forked from joegaudet/gist:5485828
Last active December 16, 2015 19:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jamesgolick/5485837 to your computer and use it in GitHub Desktop.
Save jamesgolick/5485837 to your computer and use it in GitHub Desktop.
def self.unicorn_attr(*args)
args.each do |arg|
class << self
define_method(arg) do
@attributes[arg]
end
define_method("#{arg}=") do |value|
@attributes[arg] = value
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment