別のキーワード
種類
- 文書 (44)
- インスタンスメソッド (22)
- 関数 (22)
- ライブラリ (11)
ライブラリ
- ビルトイン (22)
クラス
- Method (11)
- UnboundMethod (11)
キーワード
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (11) -
NEWS for Ruby 2
. 0 . 0 (11) -
NEWS for Ruby 2
. 5 . 0 (7) -
NEWS for Ruby 3
. 0 . 0 (4) -
clone
_ method (11) -
irb
/ completion (11) -
method
_ clone (11) - クラス/メソッドの定義 (11)
検索結果
先頭5件
-
Method
# clone -> Method (39248.0) -
自身を複製した Method オブジェクトを作成して返します。
...自身を複製した Method オブジェクトを作成して返します。
//emlist[例][ruby]{
class Foo
def foo
"foo"
end
end
m = Foo.new.method(:foo) # => #<Method: Foo#foo>
m.call # => "foo"
m.clone # => #<Method: Foo#foo>
m.clone.call # => "foo"
//}... -
UnboundMethod
# clone -> UnboundMethod (21213.0) -
自身を複製した UnboundMethod オブジェクトを作成して返します。
...自身を複製した UnboundMethod オブジェクトを作成して返します。
//emlist[例][ruby]{
a = String.instance_method(:size)
b = a.clone
a == b # => true
//}... -
static VALUE method
_ clone(VALUE self) (12200.0) -
-
static int clone
_ method(ID mid , NODE *body , st _ table *tbl) (12200.0) -
m_tbl 格納形式のメソッド (構文木) をコピーして返します。 ST_CONTINUE を返します。
m_tbl 格納形式のメソッド (構文木) をコピーして返します。
ST_CONTINUE を返します。 -
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (216.0) -
1.6.8から1.8.0への変更点(まとめ) * ((<1.6.8から1.8.0への変更点(まとめ)/インタプリタの変更>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加されたクラス/モジュール>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加されたメソッド>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加された定数>)) * ((<1.6.8から1.8.0への変更点(まとめ)/拡張されたクラス/メソッド(互換性のある変更)>)) * ((<1.6.8から1.8.0への変更点(まとめ)/変更されたクラス/メソッド(互換性のない変更)>)) * ((<1.6.8から1.8.0への変更点(まとめ)/文法の変更>)) * ((<1.6.8から1.8.0への変更点(まとめ)/正規表現>)) * ((<1.6.8から1.8.0への変更点(まとめ)/Marshal>)) * ((<1.6.8から1.8.0への変更点(まとめ)/Windows 対応>)) * ((<1.6.8から1.8.0への変更点(まとめ)/廃止された(される予定の)機能>)) * ((<1.6.8から1.8.0への変更点(まとめ)/ライブラリ>)) * ((<1.6.8から1.8.0への変更点(まとめ)/拡張ライブラリAPI>)) * ((<1.6.8から1.8.0への変更点(まとめ)/バグ修正>)) * ((<1.6.8から1.8.0への変更点(まとめ)/サポートプラットフォームの追加>))
...ことを意味する
ようになります。((<ruby-dev:20358>))
: defined? [compat]
属性代入、配列要素への代入に対して "method" でなく "assignment" を返
すようになりました。
: ((<リテラル/数値リテラル>)) [compat]
10進((*整数*))リテラル......ていればそれを実行し、その結果をブロックとして渡すようになりまし
た。以前は、& 修飾できるのは Proc, Method オブジェクト限定でした。
これに伴い Proc#to_proc が追加されました。
: 終了ステータス [compat]
raise SystemE......-dev:16183>))
一つ一つ include した場合とは逆順になります。
=== Object
: ((<Object#clone|Object/clone>)) [change]
Numeric など immutable なオブジェクトは clone できなくなりました。
((<ruby-bugs-ja:PR#94>)), ((<rubyist:0831>))
=== Range
: ((<Range#max... -
クラス/メソッドの定義 (206.0)
-
クラス/メソッドの定義 * クラス/メソッドの定義: * class * singleton_class * module * method * operator * nest_method * eval_method * singleton_method * class_method * limit * 定義に関する操作: * alias * undef * defined
...定義
* クラス/メソッドの定義:
* class
* singleton_class
* module
* method
* operator
* nest_method
* eval_method
* singleton_method
* class_method
* limit
* 定義に関する操作:
* alias
* undef
* defined
===[a:class] クラ......す。この構文の内部で定義したメソッドや定数は指定した
オブジェクトに対してだけ有効になります。
Object#clone で生成したオブジェクトには引き継がれますが,
Object#dup で生成したオブジェクトには引き継がれません.
r......式は、最後に評価した式の結果を返します。最後に評価した式
が値を返さない場合は nil を返します。
===[a:method] メソッド定義
//emlist[例][ruby]{
def fact(n)
if n == 1 then
1
else
n * fact(n-1)
end
end
//}
文法:
def メソ... -
NEWS for Ruby 3
. 0 . 0 (156.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......e, 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 longer frozen when......ad, IO#write and other related methods (e.g. IO#puts, IO#gets) may invoke the scheduler hook `#io_wait(io, events, timeout)` in a non-blocking execution context. 16786
* Kernel
* Kernel#clone when called with the `freeze: false` keyword will call `#initialize_clone` with the `freeze: false` ke... -
NEWS for Ruby 2
. 5 . 0 (66.0) -
NEWS for Ruby 2.5.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...2
* Method
* Method#=== は Proc#===と同じようにMethod#callを呼び出します 14142
* Module
* Module#attr, Module#attr_accessor, Module#attr_reader, Module#attr_writer はパブリックメソッドになりました 14132
* Module#define_method, Module#alias_method, Modu......le#undef_method, Module#remove_method はパブリックメソッドになりました 14133
* Numeric
* Numeric#step は > で0と比較できない引数が与えられたときcoerce内部で発生したエラーを隠蔽しないようになりました。
7688
* 数値の比較......に更新
* BigDecimal::VERSION を追加
* 非推奨(1.4.0で削除予定)
* BigDecimal.new
* BigDecimal.ver
* BigDecimal#clone と BigDecimal#dup は新しいインスタンスを作らなくなりました。selfを返します。
* coverage
* ブランチカバレ... -
NEWS for Ruby 2
. 0 . 0 (36.0) -
NEWS for Ruby 2.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...追加(実験的): Module#refine, スコープを限定してクラスやモジュールを拡張します。
* 拡張: Module#define_method は UnboundMethod を受け付けるようになりました
* 拡張: Module#const_get 修飾された定数名の文字列を受け付けるように......: Range#bsearch 二分探索
* RubyVM (MRI specific)
* 追加: RubyVM::InstructionSequence.of to get the instruction sequence
from a method or a block.
* 追加: RubyVM::InstructionSequence#path,
RubyVM::InstructionSequence#absolute_path,
RubyVM::InstructionSequence#labe......icitly requested such as system(..., fd=>fd).
* Kernel#respond_to? against a protected method now returns false
unless the second argument is true.
* Object#respond_to_missing?, Object#initialize_clone, Object#initialize_dup
* private になりました
* Thread#join, Thread#value... -
irb
/ completion (18.0) -
irb の completion 機能を提供するライブラリです。
...に補完します.
irb(main):001:0> in
in inspect instance_eval
include install_alias_method instance_of?
initialize install_aliases instance_variables
irb(main):001:0> inspect
"main"
irb(main):002:0> foo = Object.n......foo.protected_methods
foo.=== foo.hash foo.public_methods
foo.=~ foo.id foo.respond_to?
foo.__id__ foo.inspect foo.send
foo.__send__ foo.instance_eval foo.singleton_methods
foo.class......oo.taint
foo.clone foo.instance_variables foo.tainted?
foo.display foo.is_a? foo.to_a
foo.dup foo.kind_of? foo.to_s
foo.eql? foo.method foo.type
foo.equal? foo.methods f...