ライブラリ
- ビルトイン (64)
-
net
/ http (22) -
rubygems
/ source _ index (33)
クラス
- Array (40)
-
Gem
:: SourceIndex (33) -
Net
:: HTTPGenericRequest (22) -
RubyVM
:: InstructionSequence (11) - String (13)
キーワード
-
body
_ stream (11) -
body
_ stream= (11) - bsearch (18)
- byterindex (2)
-
each
_ index (22) - length (11)
- rindex (11)
-
to
_ a (11)
検索結果
先頭5件
-
Gem
:: SourceIndex # size -> Integer (21102.0) -
- 2.1.0
- 2.1.0
- 2.2.0
- 2.2.0
- 2.3.0
- 2.3.0
- 2.4.0
- 2.4.0
- 2.5.0
- 2.5.0
- 2.6.0
- 2.6.0
- 2.7.0
- 2.7.0
- 3.0
- 3.0
- 3.1
- 3.1
- 3.2
- 3.2
- 3.3
- 3.3
自身のサイズを返します。
自身のサイズを返します。自身に含まれる Gem の個数を返します。 -
String
# rindex(pattern , pos = self . size) -> Integer | nil (6226.0) -
文字列のインデックス pos から左に向かって pattern を探索します。 最初に見つかった部分文字列の左端のインデックスを返します。 見つからなければ nil を返します。
...列または正規表現で指定します。
pos が負の場合は、文字列の末尾から数えた位置から探索します。
rindex と String#index とでは、探索方向だけが逆になります。
完全に左右が反転した動作をするわけではありません。
探索......//emlist[String#index の場合][ruby]{
p "stringstring".index("ing", 1) # => 3
# ing # ここから探索を始める
# ing
# ing # 右にずらしていってここで見つかる
//}
//emlist[String#rindex の場合][ruby]{
p "stringstring".rindex("ing", -1) # =......ンデックス
//emlist[例][ruby]{
p "astrochemistry".rindex("str") # => 10
p "character".rindex(?c) # => 5
p "regexprindex".rindex(/e.*x/, 2) # => 1
p "foobarfoobar".rindex("bar", 6) # => 3
p "foobarfoobar".rindex("bar", -6) # => 3
//}
@see String#index... -
Array
# each _ index {|index| . . . . } -> self (6222.0) -
各要素のインデックスに対してブロックを評価します。
...ブロックを評価します。
以下と同じです。
//emlist[例][ruby]{
(0 ... ary.size).each do |index|
# ....
end
//}
ブロックが与えられなかった場合は、自身と each_index から生成した
Enumerator オブジェクトを返します。
@see Array#each, Array#reve... -
String
# byterindex(pattern , offset = self . bytesize) -> Integer | nil (6201.0) -
文字列のバイト単位のインデックス offset から左に向かって pattern を探索します。 最初に見つかった部分文字列の左端のバイト単位のインデックスを返します。 見つからなければ nil を返します。
...は正規表現で指定します。
offset が負の場合は、文字列の末尾から数えた位置から探索します。
byterindex と String#byteindex とでは、探索方向だけが逆になります。
完全に左右が反転した動作をするわけではありません。
探索......String#byteindex の場合][ruby]{
p "stringstring".byteindex("ing", 1) # => 3
# ing # ここから探索を始める
# ing
# ing # 右にずらしていってここで見つかる
//}
//emlist[String#byterindex の場合][ruby]{
p "stringstring".byterindex("ing", -1......'foo'.byterindex('f') # => 0
'foo'.byterindex('o') # => 2
'foo'.byterindex('oo') # => 1
'foo'.byterindex('ooo') # => nil
'foo'.byterindex(/f/) # => 0
'foo'.byterindex(/o/) # => 2
'foo'.byterindex(/oo/) # => 1
'foo'.byterindex(/ooo/) # => nil
# 右でのマッチが優先
'foo'.byterindex(/o+/) # =... -
Array
# each _ index -> Enumerator (6122.0) -
各要素のインデックスに対してブロックを評価します。
...ブロックを評価します。
以下と同じです。
//emlist[例][ruby]{
(0 ... ary.size).each do |index|
# ....
end
//}
ブロックが与えられなかった場合は、自身と each_index から生成した
Enumerator オブジェクトを返します。
@see Array#each, Array#reve... -
Gem
:: SourceIndex # length -> Integer (3002.0) -
自身に含まれる Gem の個数を返します。
自身に含まれる Gem の個数を返します。 -
RubyVM
:: InstructionSequence # to _ a -> Array (43.0) -
self の情報を 14 要素の配列にして返します。
...。常に 1。
: misc
以下の要素から構成される Hash オブジェクト。
:arg_size: メソッド、ブロックが取る引数の総数(1 つもない場合は 0)。
:local_size: ローカル変数の総数 + 1。
:stack_max: スタックの深さ。(SystemStackError......引数の個数。あるいは以下のよう
な配列。
[required_argc, [optional_arg_labels, ...],
splat_index, post_splat_argc, post_splat_index,
block_index, simple]
より詳細な情報については、vm_core.h を参照。
: catch_table
例外や制御構造のオ......le('num = 1 + 2')
pp iseq.to_a
# ※ Ruby 2.5.0 での実行結果
# => ["YARVInstructionSequence/SimpleDataFormat",
# 2,
# 0,
# 1,
# {:arg_size=>0, :local_size=>2, :stack_max=>2},
# "<compiled>",
# "<compiled>",
# nil,
# 1,
# :top,
# [:num],
# 0,
# [],
# [1,
# [:trace, 1],
# [:putobject_OP_INT2FI... -
Net
:: HTTPGenericRequest # body _ stream -> object (29.0) -
サーバに送るリクエストのエンティティボディを IO オブジェクトなどのストリームで設定します。 f は read(size) メソッドが定義されている必要があります。
...す。
f は read(size) メソッドが定義されている必要があります。
@param f エンティティボディのデータを得るストリームオブジェクトを与えます。
//emlist[例][ruby]{
require '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)>
//}... -
Net
:: HTTPGenericRequest # body _ stream=(f) (29.0) -
サーバに送るリクエストのエンティティボディを IO オブジェクトなどのストリームで設定します。 f は read(size) メソッドが定義されている必要があります。
...す。
f は read(size) メソッドが定義されている必要があります。
@param f エンティティボディのデータを得るストリームオブジェクトを与えます。
//emlist[例][ruby]{
require '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)>
//}...