るりまサーチ

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

別のキーワード

  1. fiddle ruby_free
  2. rbconfig ruby
  3. fiddle build_ruby_platform
  4. rake ruby
  5. rubygems/defaults ruby_engine

ライブラリ

モジュール

キーワード

検索結果

<< 1 2 3 ... > >>

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

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

...オブジェクト。

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

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

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

: #label

メソッド名、ク...
...合は "<compiled>"。

: #absolute_path

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

: #first_lineno

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

: type

命令シーケンスの種別。
:top、:method、:block、:class、:rescue、:ensur...
...数名からなる Symbol の配列。

: args

引数の指定が必須のメソッド、ブロックの引数の個数。あるいは以下のよう
な配列。

[required_argc, [optional_arg_labels, ...],
splat_index, post_splat_argc, post_splat_index,
b
lock_index, simple]...

REXML::Elements#size -> Integer (18244.0)

保持している要素の個数を返します。

...る要素の個数を返します。

//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new '<a>sean<b/>elliott<b/>russell<b/></a>'
# doc.root は3つの要素と3つのテキストノードを持つため、6を返す
doc.root.size # => 6
# そのうち要素は3つであ...
...るため、以下は3を返す
doc.root.elements.size # => 3
//}...

CSV::Table#size -> Integer (18238.0)

(ヘッダを除く)行数を返します。

...(ヘッダを除く)行数を返します。

Array#length, Array#size に委譲しています。

//emlist[][ruby]{
require 'csv'
csv = CSV.new("a,b,c\n1,2,3", headers: true)
table = csv.read
p table.size # => 1
//}

@see Array#length, Array#size...

REXML::Attributes#size -> Integer (18214.0)

属性の個数を返します。

...ます。


//emlist[][ruby]{
require 'rexml/document'

doc = REXML::Document.new(<<EOS)
<root xmlns:foo="http://example.org/foo"
xmlns:bar="http://example.org/bar">
<a foo:att='1' bar:att='2' att='&lt;'/>
</root>
EOS
a = doc.get_elements("/root/a").first

p a.attributes.length # => 3
//}...

String#bytesize -> Integer (12331.0)

文字列のバイト長を整数で返します。

...文字列のバイト長を整数で返します。

//emlist[例][ruby]{
#coding:UTF-8
# 実行結果は文字コードによって異なります。
p "いろは".size #=> 3
p "いろは".bytesize #=> 9
//}

@see String#size...

絞り込み条件を変える

File::Stat#blksize -> Integer (12313.0)

望ましいI/Oのブロックサイズを返します。

...望ましいI/Oのブロックサイズを返します。

//emlist[][ruby]{
fs = File::Stat.new($0)
#例
p fs.blksize #=> nil
//}...

String#byterindex(pattern, offset = self.bytesize) -> Integer | nil (6485.0)

文字列のバイト単位のインデックス offset から左に向かって pattern を探索します。 最初に見つかった部分文字列の左端のバイト単位のインデックスを返します。 見つからなければ nil を返します。

...列または正規表現で指定します。

offset が負の場合は、文字列の末尾から数えた位置から探索します。

b
yterindex と String#byteindex とでは、探索方向だけが逆になります。
完全に左右が反転した動作をするわけではありません...
...ing#byteindex の場合][ruby]{
p "stringstring".byteindex("ing", 1) # => 3
# ing # ここから探索を始める
# ing
# ing # 右にずらしていってここで見つかる
//}

//emlist[String#byterindex の場合][ruby]{
p "stringstring".byterindex("ing", -1)...
... -1 の文字から探索を始める
# ing
# ing # 左にずらしていってここで見つかる
//}

@param pattern 探索する部分文字列または正規表現
@param offset 探索を始めるバイト単位のインデックス

//emlist[例][ruby]{
'fo...

Random#bytes(size) -> String (6320.0)

ランダムなバイナリー文字列を返します。結果の文字列のサイズを指定できます。

...ランダムなバイナリー文字列を返します。結果の文字列のサイズを指定できます。

@param size 結果の文字列のサイズをバイト数で指定します。

//emlist[例][ruby]{
r2 = Random.new(1)
p r2.bytes(10) # => "%\xF4\xC1j\xEB\x80G\xFF\x8C/"
//}...
...ムなバイナリー文字列を返します。結果の文字列のサイズを指定できます。

@param size 結果の文字列のサイズをバイト数で指定します。

//emlist[例][ruby]{
r2 = Random.new(1)
p r2.bytes(10) # => "%\xF4\xC1j\xEB\x80G\xFF\x8C/"
//}

@see Random.bytes...

ARGF.class#binmode -> self (6303.0)

self をバイナリモードにします。一度バイナリモードになった後は非バイナリ モードに戻る事はできません。

...ASCII-8BIT として扱う

例:
# test1.png - 164B
# test2.png - 128B
# test1.png + test2.png = 292B

# $ ruby test.rb test1.png test2.png

ARGF.binmode
ARGF.read.size # => 292

例:
# test1.png - 164B
# test2.png - 128B
# test1.png + test2.png = 292B

# $ ruby test.rb test1.p...
...ng test2.png

ARGF.read.size # => 290

@see IO#binmode, ARGF.class#binmode?...

Array#bsearch -> Enumerator (6291.0)

ブロックの評価結果で範囲内の各要素の判定を行い、条件を満たす値を二分探 索(計算量は O(log n))で検索します。要素が見つからない場合は nil を返し ます。self はあらかじめソートしておく必要があります。

...本メソッドはブロックを評価した結果により以下のいずれかのモードで動作し
ます。

* find-minimum モード
* find-any モード

find-minimum モード(特に理由がない限りはこのモードを使う方がいいでしょ
う)では、条件判定の結...
...返すか、nil を返します。

//emlist[例][ruby]{
ary = [0, 4, 7, 10, 12]
ary.bsearch {|x| x >= 4 } # => 4
ary.bsearch {|x| x >= 6 } # => 7
ary.bsearch {|x| x >= -1 } # => 0
ary.bsearch {|x| x >= 100 } # => nil
//}

find-any モードは bsearch(3) のように動作します。ブロッ...
...クは真偽値
ではなく、以下のような数値を返す必要があります。求める要素が配列の i 番目
から j-1 番目までに入っているとします。またブロックパラメータの値の
インデックスを k とします。

* ブロックパラメータの...

絞り込み条件を変える

<< 1 2 3 ... > >>