300件ヒット
[1-100件を表示]
(0.097秒)
クラス
- Array (12)
- BasicObject (12)
-
Digest
:: Base (24) -
Encoding
:: Converter (48) - Hash (69)
- Object (72)
-
RubyVM
:: InstructionSequence (12) - Set (24)
- String (3)
モジュール
-
Rake
:: Cloneable (12) - Singleton (12)
キーワード
- clone (36)
- dedup (3)
- equal? (12)
- filter! (14)
- freeze (12)
- hash (12)
-
initialize
_ clone (12) -
initialize
_ copy (12) -
initialize
_ dup (12) -
keep
_ if (19) -
primitive
_ convert (48) - replace (12)
- select! (24)
-
to
_ a (12)
検索結果
先頭5件
-
Singleton
# dup (21102.0) -
@raise TypeError このメソッドを呼び出した場合に発生します。
...@raise TypeError このメソッドを呼び出した場合に発生します。... -
Object
# dup -> object (18232.0) -
オブジェクトの複製を作成して返します。
...す。
dup はオブジェクトの内容, taint 情報をコピーし、
clone はそれに加えて freeze, 特異メソッドなどの情報も含めた完全な複製を作成します。
clone や dup は浅い(shallow)コピーであることに注意してください。後述。
TrueClass......Numeric クラスのインスタンスなど一部のオブジェクトは複製ではなくインスタンス自身を返します。
@param freeze true を指定すると freeze されたコピーを返します。
false を指定すると freeze されていないコピーを返し......@raise ArgumentError TrueClass などの常に freeze されているオブジェクトの freeze されていないコピーを作成しようとしたときに発生します。
//emlist[][ruby]{
obj = "string"
obj.taint
def obj.fuga
end
obj.freeze
p(obj.equal?(obj)) #=> true
p(obj == o......します。
dup はオブジェクトの内容をコピーし、
clone はそれに加えて freeze, 特異メソッドなどの情報も含めた完全な複製を作成します。
clone や dup は浅い(shallow)コピーであることに注意してください。後述。
TrueClass, FalseC......ntError TrueClass などの常に freeze されているオブジェクトの freeze されていないコピーを作成しようとしたときに発生します。
//emlist[][ruby]{
obj = "string"
def obj.fuga
end
obj.freeze
p(obj.equal?(obj)) #=> true
p(obj == obj) #=> t... -
Rake
:: Cloneable # dup -> object (18226.0) -
自身と同じクラスのオブジェクトを作成後、自身のインスタンス変数を 全て新たに作成したオブジェクトにコピーします。
...。
//emlist[][ruby]{
# Rakefile での記載例とする
task default: :test_rake_app
task :test_rake_app do
file_list = FileList['a.c', 'b.c']
file_list.freeze
dup = file_list.dup
clone = file_list.clone
dup.exclude("a.c") # => ["b.c"]
clone.exclude("a.c") # => can't modify frozen......Rake::FileList
end
//}... -
Set
# dup -> Set (18220.0) -
集合を複製して返します。
...集合を複製して返します。
dup は、集合の内容と taint 情報のみコピーします。
clone は、それに加えて、freeze 情報と特異メソッドをコピーします。
いずれも共通して、内部記憶として保持するハッシュもコピーしますが、......集合の要素そのものはコピーしません。
Set クラスでは、dup と clone に共通して、内部記憶として
用いるハッシュも含めて taint 情報をコピーします。
ただし、clone では内部記憶の freeze 情報はコピーされません。
このため......、freeze された集合を clone した場合、生成された集合の要素は
変更可能である点に注意してください。
//emlist[][ruby]{
require 'set'
s1 = Set[10, 20]
s2 = s1.dup
s2 << 30
p s1 # => #<Set: {10, 20}>
p s2 # => #<Set: {10, 20, 30}>
//}
@see Object#clone......、freeze された集合を clone した場合、生成された集合の要素は
変更可能である点に注意してください。
//emlist[][ruby]{
s1 = Set[10, 20]
s2 = s1.dup
s2 << 30
p s1 # => #<Set: {10, 20}>
p s2 # => #<Set: {10, 20, 30}>
//}
@see Object#clone... -
Digest
:: Base # dup -> Digest :: Base (18202.0) -
ダイジェストオブジェクトの複製を作ります。
ダイジェストオブジェクトの複製を作ります。 -
Object
# initialize _ dup(obj) -> object (12224.0) -
Object#dup がオブジェクトを複製する際に呼び出すメソッドです。
...Object#dup がオブジェクトを複製する際に呼び出すメソッドです。
デフォルトでは Object#initialize_copy を呼び出します。
initialize_dup という名前のメソッドは自動的に private に設定されます。
@see Object#initialize_copy, Object#initializ... -
Encoding
:: Converter # primitive _ convert(source _ buffer , destination _ buffer , destination _ byteoffset , destination _ bytesize , options) -> Symbol (6807.0) -
エンコーディング変換のためのメソッドの中で、もっとも細かな扱いが可能なメソッドです。
...g::Converter#primitive_convert が唯一の方法になります。
@param source_buffer 変換元文字列のバッファ
@param destination_buffer 変換先文字列を格納するバッファ
@param destination_byteoffset 変換先バッファでのオフセット
@param destination_bytesize 変......ptions 変換の詳細を指定する定数やハッシュ
@return 変換結果を表す Symbol
options には以下が指定できます。
: hash form
:partial_input => true # source buffer may be part of larger source
:after_output => true # stop conversion after output......re input
: integer form
Encoding::Converter::PARTIAL_INPUT
Encoding::Converter::AFTER_OUTPUT
戻り値は以下のうちのどれかです。
* :invalid_byte_sequence
* :incomplete_input
* :undefined_conversion
* :after_output
* :destination_buffer_full
* :source_buffer_empty
* :... -
Encoding
:: Converter # primitive _ convert(source _ buffer , destination _ buffer , destination _ byteoffset , destination _ bytesize) -> Symbol (6707.0) -
エンコーディング変換のためのメソッドの中で、もっとも細かな扱いが可能なメソッドです。
...g::Converter#primitive_convert が唯一の方法になります。
@param source_buffer 変換元文字列のバッファ
@param destination_buffer 変換先文字列を格納するバッファ
@param destination_byteoffset 変換先バッファでのオフセット
@param destination_bytesize 変......ptions 変換の詳細を指定する定数やハッシュ
@return 変換結果を表す Symbol
options には以下が指定できます。
: hash form
:partial_input => true # source buffer may be part of larger source
:after_output => true # stop conversion after output......re input
: integer form
Encoding::Converter::PARTIAL_INPUT
Encoding::Converter::AFTER_OUTPUT
戻り値は以下のうちのどれかです。
* :invalid_byte_sequence
* :incomplete_input
* :undefined_conversion
* :after_output
* :destination_buffer_full
* :source_buffer_empty
* :... -
Encoding
:: Converter # primitive _ convert(source _ buffer , destination _ buffer , destination _ byteoffset) -> Symbol (6507.0) -
エンコーディング変換のためのメソッドの中で、もっとも細かな扱いが可能なメソッドです。
...g::Converter#primitive_convert が唯一の方法になります。
@param source_buffer 変換元文字列のバッファ
@param destination_buffer 変換先文字列を格納するバッファ
@param destination_byteoffset 変換先バッファでのオフセット
@param destination_bytesize 変......ptions 変換の詳細を指定する定数やハッシュ
@return 変換結果を表す Symbol
options には以下が指定できます。
: hash form
:partial_input => true # source buffer may be part of larger source
:after_output => true # stop conversion after output......re input
: integer form
Encoding::Converter::PARTIAL_INPUT
Encoding::Converter::AFTER_OUTPUT
戻り値は以下のうちのどれかです。
* :invalid_byte_sequence
* :incomplete_input
* :undefined_conversion
* :after_output
* :destination_buffer_full
* :source_buffer_empty
* :...