るりまサーチ

最速Rubyリファレンスマニュアル検索!
184件ヒット [1-100件を表示] (0.102秒)

別のキーワード

  1. _builtin to_r
  2. open3 pipeline_r
  3. matrix elements_to_r
  4. fileutils cp_r
  5. fileutils rm_r

ライブラリ

モジュール

キーワード

検索結果

<< 1 2 > >>

RubyVM::InstructionSequence#to_a -> Array (32119.0)

self の情報を 14 要素の配列にして返します。

...フォーマットを示す文字列。常に
"YARVInstructionSequence/SimpleDataFormat"。

: major_version

命令シーケンスのメジャーバージョン。

: minor_version

命令シーケンスのマイナーバージョン。

: format_type

データフォーマットを示す...
...オブジェクト。

:arg_size: メソッド、ブロックが取る引数の総数(1 つもない場合は 0)。

:local_size: ローカル変数の総数 + 1。

:stack_max: スタックの深さ。(SystemStackError を検出するために使用)

: #label

メソッド名、ク...
...led>"。

: #absolute_path

命令シーケンスの絶対パス。文字列から作成していた場合は nil。

: #first_lineno

命令シーケンスの 1 行目の行番号。

: type

命令シーケンスの種別。
:top、:method、:block、:class、:rescue、:ensure、:eval、:m...

Rake::Cloneable#dup -> object (24238.0)

自身と同じクラスのオブジェクトを作成後、自身のインスタンス変数を 全て新たに作成したオブジェクトにコピーします。

...mlist[][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::Fi...

Encoding::Converter#primitive_convert(source_buffer, destination_buffer) -> Symbol (9313.0)

エンコーディング変換のためのメソッドの中で、もっとも細かな扱いが可能なメソッドです。

...ing::Converter#primitive_convert が唯一の方法になります。

@param source_buffer 変換元文字列のバッファ
@param destination_buffer 変換先文字列を格納するバッファ
@param destination_byteoffset 変換先バッファでのオフセット
@param destination_bytesize...
...aram options 変換の詳細を指定する定数やハッシュ
@return 変換結果を表す Symbol

options には以下が指定できます。

: hash form
:partial_input => true # source buffer may be part of larger source
:after_output => true # stop conversion after...
...tput before 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_em...

Encoding::Converter#primitive_convert(source_buffer, destination_buffer, destination_byteoffset) -> Symbol (9313.0)

エンコーディング変換のためのメソッドの中で、もっとも細かな扱いが可能なメソッドです。

...ing::Converter#primitive_convert が唯一の方法になります。

@param source_buffer 変換元文字列のバッファ
@param destination_buffer 変換先文字列を格納するバッファ
@param destination_byteoffset 変換先バッファでのオフセット
@param destination_bytesize...
...aram options 変換の詳細を指定する定数やハッシュ
@return 変換結果を表す Symbol

options には以下が指定できます。

: hash form
:partial_input => true # source buffer may be part of larger source
:after_output => true # stop conversion after...
...tput before 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_em...

Encoding::Converter#primitive_convert(source_buffer, destination_buffer, destination_byteoffset, destination_bytesize) -> Symbol (9313.0)

エンコーディング変換のためのメソッドの中で、もっとも細かな扱いが可能なメソッドです。

...ing::Converter#primitive_convert が唯一の方法になります。

@param source_buffer 変換元文字列のバッファ
@param destination_buffer 変換先文字列を格納するバッファ
@param destination_byteoffset 変換先バッファでのオフセット
@param destination_bytesize...
...aram options 変換の詳細を指定する定数やハッシュ
@return 変換結果を表す Symbol

options には以下が指定できます。

: hash form
:partial_input => true # source buffer may be part of larger source
:after_output => true # stop conversion after...
...tput before 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_em...

絞り込み条件を変える

Encoding::Converter#primitive_convert(source_buffer, destination_buffer, destination_byteoffset, destination_bytesize, options) -> Symbol (9313.0)

エンコーディング変換のためのメソッドの中で、もっとも細かな扱いが可能なメソッドです。

...ing::Converter#primitive_convert が唯一の方法になります。

@param source_buffer 変換元文字列のバッファ
@param destination_buffer 変換先文字列を格納するバッファ
@param destination_byteoffset 変換先バッファでのオフセット
@param destination_bytesize...
...aram options 変換の詳細を指定する定数やハッシュ
@return 変換結果を表す Symbol

options には以下が指定できます。

: hash form
:partial_input => true # source buffer may be part of larger source
:after_output => true # stop conversion after...
...tput before 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_em...

Object#freeze -> self (9161.0)

オブジェクトを凍結(内容の変更を禁止)します。

... RuntimeError を発生させます。
いったん凍結されたオブジェクトを元に戻す方法はありません。

凍結されるのはオブジェクトであり、変数ではありません。代入などで変数の指す
オブジェクトが変化してしまうことは freez...
...freeze が防ぐのは、
`破壊的な操作' と呼ばれるもの一般です。変数への参照自体を凍結したい
場合は、グローバル変数なら Kernel.#trace_var が使えます。

@return self を返します。

//emlist[][ruby]{
a1 = "foo".freeze
a1 = "bar"
p a1 #=> "bar"...
..."foo".freeze
a2.replace("bar") # can't modify frozen String (RuntimeError)
//}

凍結を解除することはできませんが、Object#dup を使えばほぼ同じ内容の凍結されていない
オブジェクトを得ることはできます。

//emlist[][ruby]{
a = [1].freeze
p a.frozen?...
...外 FrozenError を発生させます。
いったん凍結されたオブジェクトを元に戻す方法はありません。

凍結されるのはオブジェクトであり、変数ではありません。代入などで変数の指す
オブジェクトが変化してしまうことは freeze...
...reeze
a2.replace("bar") # can't modify frozen String (FrozenError)
//}

凍結を解除することはできませんが、Object#dup を使えばほぼ同じ内容の凍結されていない
オブジェクトを得ることはできます。

//emlist[][ruby]{
a = [1].freeze
p a.frozen? #=> tr...

Hash#replace(other) -> self (6149.0)

ハッシュの内容を other の内容で置き換えます。

...内容を other の内容で置き換えます。

デフォルト値の設定もotherの内容になります。
otherがハッシュではない場合、otherのメソッドto_hashを使って暗黙の変換を試みます。

self = other.to_hash.dup と同じです。

@param other ハッシュ...
...す。
@return self を返します。

//emlist[例][ruby]{
foo = {1 => 'a', 2 => 'b'}
b
ar = {2 => 'B', 3 => 'C'}

foo.replace(bar)
p foo #=> {2=>"B", 3=>"C"}

zoo = {}
zoo = bar.dup
p zoo #=> {2=>"B", 3=>"C"}

class Foo
def to_hash
{:japan => 'kyoto'}
end
end

h = Hash.new
h.replace(Foo....
...new) #暗黙の変換
p h #=> {:japan=>"kyoto"}
//}

@see Hash#dup,Hash#merge,Object#to_hash...

Hash#filter! -> Enumerator (6119.0)

キーと値を引数としてブロックを評価した結果が真であるような要素を self に残します。

...
filter! と select! はオブジェクトが変更された場合に self を、
されていない場合に nil を返します。

ブロックが与えられなかった場合は、自身と keep_if から生成した
Enumerator オブジェクトを返します。

//emlist[例][ruby]{
h1 =...
...h1.dup
h1.select! # => #<Enumerator: {0=>"a", 1=>"b", 2=>"c", 3=>"d", 4=>"e", 5=>"f", 6=>"g"}:select!>

h1.select! { |k, v| k % 3 == 0 } # => {0=>"a", 3=>"d", 6=>"g"}
h1.select! { |k, v| true } # => nil
h2.keep_if { |k, v| k % 3 == 0 } # => {0=>"a", 3=>"d", 6=>"g"}
h2.keep_if { |k, v| true...
...} # => {0=>"a", 3=>"d", 6=>"g"}
//}

@see Hash#select, Hash#delete_if, Hash#reject!...
<< 1 2 > >>