478件ヒット
[101-200件を表示]
(0.148秒)
別のキーワード
クラス
- Array (108)
- MatchData (78)
-
Net
:: HTTP (36) -
Net
:: HTTPResponse (24) - Object (12)
-
Psych
:: Stream (24) -
Psych
:: Visitors :: YAMLTree (12) - String (40)
- Symbol (12)
- Thread (24)
-
Thread
:: ConditionVariable (24) -
Thread
:: Queue (36) -
Thread
:: SizedQueue (36)
モジュール
- GC (12)
キーワード
- [] (72)
- []= (24)
- at (12)
-
backtrace
_ locations (24) - broadcast (12)
- byteoffset (6)
-
delete
_ prefix (8) -
delete
_ prefix! (8) - deq (24)
-
end
_ with? (18) - fill (24)
-
garbage
_ collect (12) - head (12)
-
local
_ host= (12) -
local
_ port= (12) - offset (24)
- pop (24)
-
read
_ body (24) -
respond
_ to? (12) - shift (24)
- signal (12)
- slice! (24)
-
start
_ with? (18)
検索結果
先頭5件
-
MatchData
# offset(name) -> [Integer , Integer] | [nil , nil] (6165.0) -
name という名前付きグループに対応する部分文字列のオフセットの配列 [start, end] を返 します。
...トの配列 [start, end] を返
します。
//emlist[例][ruby]{
[ self.begin(name), self.end(name) ]
//}
と同じです。nameの名前付きグループにマッチした部分文字列がなければ
[nil, nil] を返します。
@param name 名前(シンボルか文字列)
@raise IndexErr......emlist[例][ruby]{
/(?<year>\d{4})年(?<month>\d{1,2})月(?:(?<day>\d{1,2})日)?/ =~ "2021年1月"
p $~.offset('year') # => [0, 4]
p $~.offset(:year) # => [0, 4]
p $~.offset('month') # => [5, 6]
p $~.offset(:month) # => [5, 6]
p $~.offset('day') # => [nil, nil]
p $~.offset('century')......# => `offset': undefined group name reference: century (IndexError)
//}
@see MatchData#begin, MatchData#end......# => `offset': undefined group name reference: century (IndexError)
//}
@see MatchData#begin, MatchData#end, MatchData#offset... -
GC
# garbage _ collect(full _ mark: true , immediate _ sweep: true) -> nil (6155.0) -
ガーベージコレクトを開始します。
...GC.start や ObjectSpace.#garbage_collect と同じ働きをします。
GC.disable により GC が禁止されている場合は何もしません。
nil を返します。
@param full_mark マイナー GC を動作させる場合は false を、そうでない場
合は true......を指定します。
@param immediate_sweep sweep を遅らせる(Lazy Sweep を行う)場合は false
を、そうでない場合は true を指定します。
注意: これらのキーワード引数は Ruby の実装やバージョンによって異なりま
す。将......来のバージョンとの互換性も保証されません。また、Ruby の実装がサポー
トしていない場合はキーワード引数を指定しても無視される可能性があります。
//emlist[例][ruby]{
include GC
GC.count # => 3
garbage_collect
GC.count # => 4
//}......ベージコレクトを開始します。
GC.start や ObjectSpace.#garbage_collect と同じ働きをします。
GC.disable により GC が禁止されている場合でもガベージコレクトを開始します。
nil を返します。
@param full_mark マイナー GC を動作させる......場
合は true を指定します。
@param immediate_sweep sweep を遅らせる(Lazy Sweep を行う)場合は false
を、そうでない場合は true を指定します。
注意: これらのキーワード引数は Ruby の実装やバージョンに......将来のバージョンとの互換性も保証されません。また、Ruby の実装がサポー
トしていない場合はキーワード引数を指定しても無視される可能性があります。
//emlist[例][ruby]{
include GC
GC.count # => 3
garbage_collect
GC.count # => 4
//}... -
MatchData
# offset(n) -> [Integer , Integer] | [nil , nil] (6155.0) -
n 番目の部分文字列のオフセットの配列 [start, end] を返 します。
...オフセットの配列 [start, end] を返
します。
//emlist[例][ruby]{
[ self.begin(n), self.end(n) ]
//}
と同じです。n番目の部分文字列がマッチしていなければ
[nil, nil] を返します。
@param n 部分文字列を指定する数値
@raise IndexError 範囲外......の n を指定した場合に発生します。
@see MatchData#begin, MatchData#end......の n を指定した場合に発生します。
@see MatchData#begin, MatchData#end, MatchData#offset... -
String
# delete _ prefix!(prefix) -> self | nil (6149.0) -
self の先頭から破壊的に prefix を削除します。
...。
@param prefix 先頭から削除する文字列を指定します。
@return 削除した場合は self、変化しなかった場合は nil
//emlist[][ruby]{
"hello".delete_prefix!("hel") # => "lo"
"hello".delete_prefix!("llo") # => nil
//}
@see String#delete_prefix
@see String#delete_suffi......x!
@see String#start_with?... -
String
# delete _ prefix(prefix) -> String (6149.0) -
文字列の先頭から prefix を削除した文字列のコピーを返します。
...
@param prefix 先頭から削除する文字列を指定します。
@return 文字列の先頭から prefix を削除した文字列のコピー
//emlist[][ruby]{
"hello".delete_prefix("hel") # => "lo"
"hello".delete_prefix("llo") # => "hello"
//}
@see String#delete_prefix!
@see String#delete_......suffix
@see String#start_with?... -
Thread
:: SizedQueue # shift(non _ block = false) -> object (6149.0) -
キューからひとつ値を取り出します。 キューに push しようと待っているスレッドがあれば、実行を再開させます。
...ば、実行を再開させます。
@param non_block true を与えると、キューが空の時に例外 ThreadError が発生します。
//emlist[例][ruby]{
require 'thread'
q = SizedQueue.new(4)
th1 = Thread.start do
while resource = q.pop
puts resource
end
end
[:resource1, :reso......ush(r)
}
th1.join
# => resource1
# resource2
# resource3
//}
//emlist[例: nonblock = true][ruby]{
require 'thread'
q = SizedQueue.new(4)
th1 = Thread.start do
while resource = q.pop
puts resource
end
end
[:resource1, :resource2, :resource3, nil].each{|r|
q.push(r)
}
begin
th1.join......q.pop(true)
rescue => e
p e
p e.message
end
# => resource1
# resource2
# resource3
# => #<ThreadError: queue empty>
# => "queue empty"
//}
@see Thread::Queue#pop... -
Thread
:: Queue # shift(non _ block = false) -> object (6143.0) -
キューからひとつ値を取り出します。キューが空の時、呼出元のスレッドは停止します。
...出元のスレッドは停止します。
@param non_block true を与えると、キューが空の時に例外 ThreadError が発生します。
//emlist[例][ruby]{
require 'thread'
q = Queue.new
th1 = Thread.start do
while resource = q.pop
puts resource
end
end
[:resource1, :resour......ch { |r|
q.push(r)
}
th1.join
//}
//emlist[例: nonblock = true][ruby]{
require 'thread'
q = Queue.new
th1 = Thread.start do
while resource = q.pop
puts resource
end
end
[:resource1, :resource2, :resource3, nil].each { |r|
q.push(r)
}
begin
th1.join
q.pop(true)
rescue => e
p......e
end
# => resource1
# resource2
# resource3
# => #<ThreadError: queue empty>
# => "queue empty"
//}... -
Net
:: HTTP # local _ port=(port) (6137.0) -
接続に用いるローカルポートを設定します。
...
@param port ローカルポート(数値、もしくはサービス名文字列)
//emlist[例][ruby]{
require 'net/http'
http = Net::HTTP.new("www.example.com")
http.local_host = "192.168.0.5"
http.local_port = "53043"
http.start do |h|
p h.get("/").body
end
//}
@see Net::HTTP#local_port=, N......et::HTTP#local_host
@see Net::HTTP.new... -
String
# end _ with?(*strs) -> bool (6137.0) -
self の末尾が strs のいずれかであるとき true を返します。
...strs のいずれかであるとき true を返します。
@param strs パターンを表す文字列 (のリスト)
//emlist[例][ruby]{
"string".end_with?("ing") # => true
"string".end_with?("str") # => false
"string".end_with?("str", "ing") # => true
//}
@see String#sta......rt_with?
@see String#delete_suffix, String#delete_suffix!... -
Symbol
# end _ with?(*suffixes) -> bool (6137.0) -
self の末尾が suffixes のいずれかであるとき true を返します。
...とき true を返します。
(self.to_s.end_with?と同じです。)
@param suffixes パターンを表す文字列 (のリスト)
@see Symbol#start_with?
@see String#end_with?
//emlist[][ruby]{
:hello.end_with?("ello") #=> true
# returns true if one of the +suffixes+ matches.......:hello.end_with?("heaven", "ello") #=> true
:hello.end_with?("heaven", "paradise") #=> false
//}... -
Net
:: HTTP # local _ host=(host) (6131.0) -
接続に用いるローカルホスト名を指定します。
...
@param host ホスト名、もしくはアドレスを示す文字列
//emlist[例][ruby]{
require 'net/http'
http = Net::HTTP.new("www.example.com")
http.local_host = "192.168.0.5"
http.local_port = "53043"
http.start do |h|
p h.get("/").body
end
//}
@see Net::HTTP#local_host=, Net::HTTP#lo......cal_port...