Ruby , private Object, , Ruby. Ruby - , , .
def say_goodnight(name)
result = "Goodnight, " + name
return result
end
Object.private_methods.include? :say_goodnight
=> true
private Object, , . , ?
, Ruby Object, main, , . , , main ( Object), .
self
=> main
self.class
=> Object
self.private_methods.include? :say_goodnight
=> true
:
, , main .