るりまサーチ

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

別のキーワード

  1. string []=
  2. string slice
  3. string slice!
  4. string []
  5. string gsub

ライブラリ

クラス

検索結果

Module#alias_method(new, original) -> Symbol (18191.0)

メソッドの別名を定義します。

...メソッドの別名を定義します。

//emlist[例][ruby]{
module Kernel
alias_method
:hoge, :puts # => :hoge
alias_method
"foo", :puts # => :foo
end
//}

alias との違いは以下の通りです。

* メソッド名は String または Symbol で指定します
* グローバル...
...できません。

@
param new 新しいメソッド名。String または Symbol で指定します。

@
param original 元のメソッド名。String または Symbol で指定します。

@
return 作成したエイリアスのメソッド名を表す Symbol を返します。

@
see d:spec/def#al...
...ias

//emlist[例][ruby]{
module Kernel
alias_method
:foo, :puts
end

foo "bar" # bar
//}...

Module#alias_method(new, original) -> self (18185.0)

メソッドの別名を定義します。

...メソッドの別名を定義します。

//emlist[例][ruby]{
module Kernel
alias_method
:hoge, :puts # => Kernel
end
//}

alias との違いは以下の通りです。

* メソッド名は String または Symbol で指定します
* グローバル変数の別名をつけることはで...
...せん。

@
param new 新しいメソッド名。String または Symbol で指定します。

@
param original 元のメソッド名。String または Symbol で指定します。

@
return self を返します。

@
see d:spec/def#alias

//emlist[例][ruby]{
module Kernel
alias_method
:foo, :puts...

NEWS for Ruby 3.0.0 (3723.0)

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

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

それぞれのエントリーは参照情報があるため短いです。
十分な情報と共に書かれた全ての変更のリス...
...", "f", 3]
in [*pre, String => x, String => y, *post]
p pre #=> ["a", 1]
p x #=> "b"
p y #=> "c"
p post #=> [2, "d", "e", "f", 3]
end
//}

* Endless method definition is added. [EXPERIMENTAL]
16746

//emlist{
def square(x) = x * x
//}

* Interpolated String literals are no lo...
...nger frozen when
`# frozen-string-literal: true` is used. 17104
* Magic comment `shareable_constant_value` added to freeze constants.
See {Magic Comments}[rdoc-ref:doc/syntax/comments.rdoc@Magic+Comments] for more details.
17273
* A {static analysis}[rdoc-label:label-Static+analysis]...

クラス/メソッドの定義 (342.0)

クラス/メソッドの定義 * クラス/メソッドの定義: * class * singleton_class * module * method * operator * nest_method * eval_method * singleton_method * class_method * limit * 定義に関する操作: * alias * undef * defined

...hod
* class_method
* limit
* 定義に関する操作:
* alias
* undef
* defined

===[a:class] クラス定義

//emlist[例][ruby]{
class Foo < Super
def test
# ...
end
# ...
end
//}

文法:

class 識別子 [`<' superclass ]
式..
en...
...生します。

//emlist[][ruby]{
class Foo < Array
def foo
end
end

# 定義を追加(スーパークラス Array を明示的に指定しても同じ)
class Foo
def bar
end
end

# 間違ったスーパークラスを指定するとエラー
class Foo < String
end
# => superclass mismatch...
...係などの機能的な関連はまったくありません。

//emlist[][ruby]{
class Foo
class Bar
end
end
//}

クラス Foo が既に定義されていれば、以下の書き方もできます。

//emlist[][ruby]{
class Foo
end

class Foo::Bar
end
//}

クラスのネストは、意味...