96件ヒット
[1-96件を表示]
(0.072秒)
別のキーワード
検索結果
先頭5件
-
Object
# clone(freeze: nil) -> object (8.0) -
オブジェクトの複製を作成して返します。
...e されていれば freeze されたコピーを、freeze されていなければ freeze されていないコピーを返します。
@raise ArgumentError TrueClass などの常に freeze されているオブジェクトの freeze されていないコピーを作成しようとしたときに......_d) #=> true
p(obj_d.tainted?) #=> true
p(obj_d.frozen?) #=> false
p(obj_d.respond_to?(:fuga)) #=> false
//}
@see Object#initialize_copy
=== 深いコピーと浅いコピー
clone や dup はオブジェクト自身を複製するだけで、オブジェクトの......d) #=> true
p(obj_d.tainted?) #=> false
p(obj_d.frozen?) #=> false
p(obj_d.respond_to?(:fuga)) #=> false
//}
@see Object#initialize_copy
=== 深いコピーと浅いコピー
clone や dup はオブジェクト自身を複製するだけで、オブジェクトの......obj_d)) #=> false
p(obj == obj_d) #=> true
p(obj_d.frozen?) #=> false
p(obj_d.respond_to?(:fuga)) #=> false
//}
@see Object#initialize_copy
=== 深いコピーと浅いコピー
clone や dup はオブジェクト自身を複製するだけで、オブジェクトの... -
Object
# dup -> object (8.0) -
オブジェクトの複製を作成して返します。
...e されていれば freeze されたコピーを、freeze されていなければ freeze されていないコピーを返します。
@raise ArgumentError TrueClass などの常に freeze されているオブジェクトの freeze されていないコピーを作成しようとしたときに......_d) #=> true
p(obj_d.tainted?) #=> true
p(obj_d.frozen?) #=> false
p(obj_d.respond_to?(:fuga)) #=> false
//}
@see Object#initialize_copy
=== 深いコピーと浅いコピー
clone や dup はオブジェクト自身を複製するだけで、オブジェクトの......d) #=> true
p(obj_d.tainted?) #=> false
p(obj_d.frozen?) #=> false
p(obj_d.respond_to?(:fuga)) #=> false
//}
@see Object#initialize_copy
=== 深いコピーと浅いコピー
clone や dup はオブジェクト自身を複製するだけで、オブジェクトの......obj_d)) #=> false
p(obj == obj_d) #=> true
p(obj_d.frozen?) #=> false
p(obj_d.respond_to?(:fuga)) #=> false
//}
@see Object#initialize_copy
=== 深いコピーと浅いコピー
clone や dup はオブジェクト自身を複製するだけで、オブジェクトの... -
Object
# enum _ for(method = :each , *args) -> Enumerator (8.0) -
Enumerator.new(self, method, *args) を返します。
...num) #=> #<Enumerator: [1, 2, 3]:each>
//}
//emlist[例(ブロックを指定する場合)][ruby]{
module Enumerable
def repeat(n)
raise ArgumentError, "#{n} is negative!" if n < 0
unless block_given?
# __method__ はここでは :repeat
return to_enum(__method__, n) do... -
Object
# enum _ for(method = :each , *args) {|*args| . . . } -> Enumerator (8.0) -
Enumerator.new(self, method, *args) を返します。
...num) #=> #<Enumerator: [1, 2, 3]:each>
//}
//emlist[例(ブロックを指定する場合)][ruby]{
module Enumerable
def repeat(n)
raise ArgumentError, "#{n} is negative!" if n < 0
unless block_given?
# __method__ はここでは :repeat
return to_enum(__method__, n) do... -
Object
# public _ send(name , *args) -> object (8.0) -
オブジェクトの public メソッド name を args を引数にして呼び出し、メソッ ドの実行結果を返します。
...}
@param name 文字列かSymbol で指定するメソッド名です。
@param args 呼び出すメソッドに渡す引数です。
@raise ArgumentError name を指定しなかった場合に発生します。
@raise NoMethodError protected メソッドや private メソッドに対して実......行
した場合に発生します。
//emlist[][ruby]{
1.public_send(:puts, "hello") # => NoMethodError
//}
@see BasicObject#__send__, Object#send... -
Object
# public _ send(name , *args) { . . . . } -> object (8.0) -
オブジェクトの public メソッド name を args を引数にして呼び出し、メソッ ドの実行結果を返します。
...}
@param name 文字列かSymbol で指定するメソッド名です。
@param args 呼び出すメソッドに渡す引数です。
@raise ArgumentError name を指定しなかった場合に発生します。
@raise NoMethodError protected メソッドや private メソッドに対して実......行
した場合に発生します。
//emlist[][ruby]{
1.public_send(:puts, "hello") # => NoMethodError
//}
@see BasicObject#__send__, Object#send... -
Object
# to _ enum(method = :each , *args) -> Enumerator (8.0) -
Enumerator.new(self, method, *args) を返します。
...num) #=> #<Enumerator: [1, 2, 3]:each>
//}
//emlist[例(ブロックを指定する場合)][ruby]{
module Enumerable
def repeat(n)
raise ArgumentError, "#{n} is negative!" if n < 0
unless block_given?
# __method__ はここでは :repeat
return to_enum(__method__, n) do... -
Object
# to _ enum(method = :each , *args) {|*args| . . . } -> Enumerator (8.0) -
Enumerator.new(self, method, *args) を返します。
...num) #=> #<Enumerator: [1, 2, 3]:each>
//}
//emlist[例(ブロックを指定する場合)][ruby]{
module Enumerable
def repeat(n)
raise ArgumentError, "#{n} is negative!" if n < 0
unless block_given?
# __method__ はここでは :repeat
return to_enum(__method__, n) do...