Skip to content

End of Life Ruby 3.0 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →

instance method

Module#public

public → self
public(symbol, ...) → self
public(string, ...) → self
public(array) → self

With no arguments, sets the default visibility for subsequently defined methods to public. With arguments, sets the named methods to have public visibility. String arguments are converted to symbols. An Array of Symbols and/or Strings are also accepted.

Ruby version changes

  1. 3.0