public is default : Public « Class « Ruby






public is default


class MyClass
  def public_method1
  end

  def public_method2
  end

  protected

  def protected_method1
  end

  private

  def private_method1
  end

  def private_method2
  end
end

 








Related examples in the same category

1.A class member marked public is accessible by anyone from anywhere; it is the default.