るりまサーチ

最速Rubyリファレンスマニュアル検索!
29件ヒット [1-29件を表示] (0.027秒)
トップページ > クエリ:Module[x] > クエリ:class[x] > クエリ:public_class_method[x]

別のキーワード

  1. argf.class each_line
  2. argf.class each
  3. argf.class lines
  4. argf.class gets
  5. argf.class readline

ライブラリ

クラス

検索結果

Module#public_class_method(*name) -> self (45234.0)

name で指定したクラスメソッド (クラスの特異メソッド) の 可視性を public に変更します。

...0 個以上の String または Symbol を Array で指定します。

//emlist[例][ruby]{
class
Foo
def self.foo
"foo"
end

private_class_method :foo
end

Foo.foo # NoMethodError: private method `foo' called for Foo:Class

Foo.public_class_method(:foo) # => Foo
Foo.foo # => "foo"
//}...

Module#public_class_method(names) -> self (45234.0)

name で指定したクラスメソッド (クラスの特異メソッド) の 可視性を public に変更します。

...0 個以上の String または Symbol を Array で指定します。

//emlist[例][ruby]{
class
Foo
def self.foo
"foo"
end

private_class_method :foo
end

Foo.foo # NoMethodError: private method `foo' called for Foo:Class

Foo.public_class_method(:foo) # => Foo
Foo.foo # => "foo"
//}...

NEWS for Ruby 3.0.0 (192.0)

NEWS for Ruby 3.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

...n singleton class definitions in methods is now a SyntaxError
instead of a warning. yield in a class definition outside of a method
is now a SyntaxError instead of a LocalJumpError. 15575
* When a class variable is overtaken by the same definition in an
ancestor class/module, a Runtim...
...eError is now raised (previously,
it only issued a warning in verbose mode). Additionally, accessing a
class
variable from the toplevel scope is now a RuntimeError.
14541
* Assigning to a numbered parameter is now a SyntaxError instead of
a warning.

== Command line options

=== `...
... modules that have already included or prepended the receiver, mirroring the behavior if the arguments were included in the receiver before the other modules and classes included or prepended the receiver. 9573
* Module#public, Module#protected, Module#private, Module#public_class_method, Module...