Skip to content

Instantly share code, notes, and snippets.

Created June 9, 2017 18:35
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 anonymous/e907694878be243386660901d73b59f0 to your computer and use it in GitHub Desktop.
Save anonymous/e907694878be243386660901d73b59f0 to your computer and use it in GitHub Desktop.
Crystal include module in module
module X
getter :x
@x= 1
def func1
p :func1
end
end
module Y
getter :y
include X
@y= 2
def func2
p :func2
end
end
class A
include Y
end
a= A.new
a.func2
a.func1
p a.y
p a.x
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment