Skip to content

Instantly share code, notes, and snippets.

@thiagovsk
Created May 16, 2016 13:34
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 thiagovsk/72657427095c5b3715505904d94e2c86 to your computer and use it in GitHub Desktop.
Save thiagovsk/72657427095c5b3715505904d94e2c86 to your computer and use it in GitHub Desktop.
criando modulo sendo incluido na classe como metodo de instancia
module Foo
def self.included base
base.extend ClassMethods
end
module ClassMethods
def bar2
puts 'bar2'
end
end
end
class Test
include Foo
end
Test.bar2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment