Skip to content

Instantly share code, notes, and snippets.

@LolWalid
Last active July 25, 2022 08:01
Show Gist options
  • Save LolWalid/1d6ccf95b6e0a90a90f7f74fedaf3edc to your computer and use it in GitHub Desktop.
Save LolWalid/1d6ccf95b6e0a90a90f7f74fedaf3edc to your computer and use it in GitHub Desktop.
How to make private static method in ruby.
class MyClass
def self.public
"I'm public."
end
private # this is useless
def self.private
"I'm also public."
end
end
class MyClass2
class << self
def public
"I'm public."
end
private
def private
"I'm private, Yeah !"
end
end
end
@Bilge
Copy link

Bilge commented Aug 22, 2017

# Ruby is useless.

@sunjayaali
Copy link

# Ruby is useless.

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment