included:
the method defines the action to do when the class or module get included extend:
extend the class's ability by including module
ex:
module M
end
Class C
end
c= C.new
c.extend(M)
note: use object to extend, get instance method,
use class to extend, get class method
沒有留言:
張貼留言