Created
April 29, 2016 18:06
-
-
Save EmanuelCadems/45fc37106651e83148514b7aa5aa7519 to your computer and use it in GitHub Desktop.
How to define private method for using into a class method
This file contains 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 characters
class Ej | |
class << self | |
def bar | |
my_method | |
end | |
private | |
def my_method | |
'hola mundo' | |
end | |
end | |
end | |
p Ej.bar | |
p Ej.my_method |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The same thing: