Skip to content

Instantly share code, notes, and snippets.

@danimal141
Created March 15, 2014 09:01
Show Gist options
  • Save danimal141/9563725 to your computer and use it in GitHub Desktop.
Save danimal141/9563725 to your computer and use it in GitHub Desktop.
ClassMethods test
module M1
class << self
def included(klass)
p klass
klass.extend ClassMethods
end
end
def method_i
p 'InstanceMethodですよー'
end
module ClassMethods
def method_c
p 'ClassMethodsからきましたよー'
end
end
end
class C1
include M1
end
C1.method_c
C1.new.method_i
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment