why self.method_name cannot access private method ? where as only private method_name can in any method can access private method in ruby

前端 未结 0 1700
遥遥无期
遥遥无期 2021-01-24 12:47
class Person
def one
    @var = 99
    self.two
end
private
def two
    p @var
end
end

p=Person.new p.one

when i run this code code i get error a

相关标签:
回答
  • 消灭零回复
提交回复
热议问题