るりまサーチ

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

別のキーワード

  1. _builtin new
  2. _builtin inspect
  3. _builtin []
  4. _builtin to_s
  5. _builtin each

ライブラリ

クラス

検索結果

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

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

...) の
可視性を public に変更します。

@param name 0 個以上の String または Symbol を指定します。
@param names 0 個以上の String または Symbol を Array で指定します。

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

private_class_method :foo
e...
...nd

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 (24214.0)

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

...) の
可視性を public に変更します。

@param name 0 個以上の String または Symbol を指定します。
@param names 0 個以上の String または Symbol を Array で指定します。

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

private_class_method :foo
e...
...nd

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 (114.0)

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

...positional arguments.
Code that resulted in deprecation warnings in Ruby 2.7 will now
result in ArgumentError or different behavior. 14183
* Procs accepting a single rest argument and keywords are no longer
subject to autosplatting. This now matches the behavior of Procs
accepting...
...standard input and output are tty, the `--help`
option shows the help message via the pager designated by the value.
16754

=== `--backtrace-limit` option

The `--backtrace-limit` option limits the maximum length of a backtrace.
8661

== Core classes updates

Outstanding ones only.

* Array
*...
...ave 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#private_class_...