Call super on private method

Posted by opsb on Stack Overflow See other posts from Stack Overflow or by opsb
Published on 2010-05-08T10:36:08Z Indexed on 2010/05/08 10:38 UTC
Read the original article Hit count: 201

Filed under:
|
class A
  private
  def greet
    puts "hello!"
  end
end

class B < A
  def greet
    super
  end
end

B.new.greet # => Attempt to call private method

because super isn't a method you can't use the usual send(:super). So how's it done?

© Stack Overflow or respective owner

Related posts about ruby

Related posts about ruby-on-rails