Created
November 12, 2018 09:41
-
-
Save karuppasamy/a26547be3bd9efd91cbdcfbe59db1411 to your computer and use it in GitHub Desktop.
Revisions
-
karuppasamy created this gist
Nov 12, 2018 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,44 @@ module Bar def self.included(base) class << base def public_method # public method puts "public method" end def call_private # public method puts "Call Private from Public" private_method end private def private_method puts "Private method" end end end def module_method puts "module method" end def call_module_private_method puts "Call module private method from module inst" module_private_method end private def module_private_method puts "module private method" end end class Foo include Bar end Foo.public_method Foo.call_private Foo.private_method # fail Foo.new.module_method Foo.new.call_module_private_method Foo.new.module_private_method # fail