Skip to content

Instantly share code, notes, and snippets.

@maiha
Forked from fridgerator/test.cr
Created November 27, 2016 03:59
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 maiha/d39b48fa40d91002ee252cfe93bc2be2 to your computer and use it in GitHub Desktop.
Save maiha/d39b48fa40d91002ee252cfe93bc2be2 to your computer and use it in GitHub Desktop.
class Changeset(T)
def initialize(@instance : T)
end
end
module Cset(T)
def changeset(instance)
Changeset(T).new(instance)
end
end
class User
extend Cset(User)
end
user = User.new
User.changeset(user)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment