るりまサーチ

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

別のキーワード

  1. _builtin define_method
  2. irb/input-method gets
  3. irb/input-method new
  4. irb/input-method readable_atfer_eof?
  5. irb/input-method encoding

ライブラリ

クラス

キーワード

検索結果

Module#private_class_method(*name) -> self (51370.0)

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

...視性を private に変更します。

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

//emlist[例][ruby]{
module
Foo
def self.foo; end
end

Foo.singleton_class.private_method_defined?...
...(:foo) # => false
Foo.private_class_method(:foo) # => Foo
Foo.singleton_class.private_method_defined?(:foo) # => true
//}...

Module#private_class_method(names) -> self (51370.0)

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

...視性を private に変更します。

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

//emlist[例][ruby]{
module
Foo
def self.foo; end
end

Foo.singleton_class.private_method_defined?...
...(:foo) # => false
Foo.private_class_method(:foo) # => Foo
Foo.singleton_class.private_method_defined?(:foo) # => true
//}...

Module#public_class_method(*name) -> self (27138.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 (27138.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 (252.0)

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

...a=>1}] # and deprecation warning
# 3.0 => a=>1}, {}]
//}

* Arguments forwarding (`...`) now supports leading arguments.
16378

//emlist{
def method_missing(meth, ...)
send(:"do_#{meth}", ...)
end
//}

* Pattern matching (`case/in`) is no longer experimental. 17260
* One-line pattern...
...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 RuntimeError is n...
... 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...

絞り込み条件を変える