るりまサーチ

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

別のキーワード

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

ライブラリ

クラス

キーワード

検索結果

Module#private_class_method(*name) -> self (24308.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 (24308.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(*name) -> self (24307.0)

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

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

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

//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_meth...
...od_defined?(:foo) # => true
//}...

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

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

...性を public に変更します。

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

//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(...
...視性を 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
end

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

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

Module#public_class_method(names) -> self (6206.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
end

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

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

絞り込み条件を変える

NEWS for Ruby 3.0.0 (306.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...
...tion 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 matching is redesig...
...ady 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_method,...