るりまサーチ

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

別のキーワード

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

ライブラリ

モジュール

キーワード

検索結果

<< 1 2 3 ... > >>

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

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

...list[][ruby]{
r
equire '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.el...
...ements.size # => 3
//}...

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

属性の個数を返します。

...ます。


//emlist[][ruby]{
r
equire '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
//}...

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

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

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

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

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

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

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

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

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

引数 pattern は探索する部分文字列または正規表現...
...で指定します。

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

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

//emlist[String#byterindex の場合][ruby]{
p "stringstring".byterindex("i...

String#bytesize -> Integer (15325.0)

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

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

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

@see String#size...

絞り込み条件を変える

RubyVM::InstructionSequence#to_a -> Array (15149.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...

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

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

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

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

Range#bsearch -> Enumerator (12249.0)

ブロックの評価結果で範囲内の各要素の大小判定を行い、条件を満たす値を二 分探索(計算量は O(log n))で検索します。要素が見つからない場合は nil を 返します。

...場合: true を返す
* 求める値がブロックパラメータより後の要素の場合: false を返す

ブロックの評価結果が true になる最初の要素を返すか、nil を返します。


//emlist[例][ruby]{
ary = [0, 4, 7, 10, 12]
(0...ary.size).bsearch {|i| ary[i] >= 4 }...
...# => 1
(0...ary.size).bsearch {|i| ary[i] >= 6 } # => 2
(0...ary.size).bsearch {|i| ary[i] >= 8 } # => 3
(0...ary.size).bsearch {|i| ary[i] >= 100 } # => nil

(0.0...Float::INFINITY).bsearch {|x| Math.log(x) >= 0 } # => 1.0
//}

find-any モードは bsearch(3) のように動作します。ブロ...
...][ruby]{
ary = [0, 100, 100, 100, 200]
(0..4).bsearch {|i| 100 - ary[i] } # => 1, 2 or 3
(0..4).bsearch {|i| 300 - ary[i] } # => nil
(0..4).bsearch {|i| 50 - ary[i] } # => nil
//}

上記の 2 つのモードを混在して使用しないでください(ブロックの評価結果は
常に true/fa...

Range#bsearch {|obj| ... } -> object | nil (12249.0)

ブロックの評価結果で範囲内の各要素の大小判定を行い、条件を満たす値を二 分探索(計算量は O(log n))で検索します。要素が見つからない場合は nil を 返します。

...場合: true を返す
* 求める値がブロックパラメータより後の要素の場合: false を返す

ブロックの評価結果が true になる最初の要素を返すか、nil を返します。


//emlist[例][ruby]{
ary = [0, 4, 7, 10, 12]
(0...ary.size).bsearch {|i| ary[i] >= 4 }...
...# => 1
(0...ary.size).bsearch {|i| ary[i] >= 6 } # => 2
(0...ary.size).bsearch {|i| ary[i] >= 8 } # => 3
(0...ary.size).bsearch {|i| ary[i] >= 100 } # => nil

(0.0...Float::INFINITY).bsearch {|x| Math.log(x) >= 0 } # => 1.0
//}

find-any モードは bsearch(3) のように動作します。ブロ...
...][ruby]{
ary = [0, 100, 100, 100, 200]
(0..4).bsearch {|i| 100 - ary[i] } # => 1, 2 or 3
(0..4).bsearch {|i| 300 - ary[i] } # => nil
(0..4).bsearch {|i| 50 - ary[i] } # => nil
//}

上記の 2 つのモードを混在して使用しないでください(ブロックの評価結果は
常に true/fa...

Net::HTTPGenericRequest#body_stream -> object (12235.0)

サーバに送るリクエストのエンティティボディを IO オブジェクトなどのストリームで設定します。 f は read(size) メソッドが定義されている必要があります。

...ムで設定します。
f は read(size) メソッドが定義されている必要があります。

@param f エンティティボディのデータを得るストリームオブジェクトを与えます。

//emlist[例][ruby]{
r
equire 'net/http'

uri = URI.parse('http://www.example.com/index...
....html')
post = Net::HTTP::Post.new(uri.request_uri)
File.open("/path/to/test", 'rb') do |f|
# 大きなファイルを扱う際にメモリ消費を少なくできる
post.body_stream = f
post["Content-Length"] = f.size
end
post.body_stream # => #<File:/path/to/test (closed)>
//}...

絞り込み条件を変える

<< 1 2 3 ... > >>