Hello,
I am trying to improve my understanding of encapsulation but I can't
understand the reason why the last 2 method calls in the following code
produce different results (cut and paste in irb, plus return key):

class N
  def initialize(n)
    @number=n
  end
    
  def self_n_wrapper
    self.n
  end
  
  def n_wrapper
     n
  end
  
private

  def n
    @number
  end
  
end

a=N.new(8)
a.n_wrapper
a.self_n_wrapper


Thanks for help
Andrea


-- 

http://myretrocomputing.altervista.org