るりまサーチ

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

別のキーワード

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

キーワード

検索結果

<< < ... 43 44 45 >>

WIN32OLE_EVENT#handler=(obj) -> () (43.0)

イベント処理を実行するオブジェクトを登録します。

...ラはイベント名に「on」を前置します。もし、イベントに対応
するonメソッドが実装されていなければmethod_missingが呼ばれます。イベン
ト名は大文字小文字を区別するため、正確な記述が必要です。

@
param obj イベントに対応...
...

class IeHandler
def initialize
@
completed = false
end
attr_reader :completed
def onDocumentComplete(disp, uri)
disp.document.getElementsByTagName('a').each do |e|
puts "#{e.innerHTML}=#{e.href}"
end
@
completed = true
end
def method_missi...
...ternetExplorer.Application.1')
event = WIN32OLE_EVENT.new(ie, 'DWebBrowserEvents2')
event.handler = IeHandler.new
ie.Navigate2 'http://www.ruby-lang.org/ja/'
loop do
break if event.handler.completed
WIN32OLE_EVENT.message_loop
end
ie.Quit

WIN32OLE_EVENT#on_eventなどの呼び...

Ripper::Filter#parse(init = nil) -> object (41.0)

自身の持つ Ruby プログラムの解析を開始します。各種イベントハンドラで処 理を行った結果を返します。

...自身の持つ Ruby プログラムの解析を開始します。各種イベントハンドラで処
理を行った結果を返します。

@
param init 任意の値を指定できます。この値がイベントハンドラに渡されていきます。

引数 init を初期値としてイベ...
...ントハンドラに渡されていきます。各種イベン
トハンドラの戻り値は次のイベントハンドラに渡されます。
Enumerable#inject のように、最終的な結果を戻り値として返します。

@
see Ripper::Filter#on_default, Ripper::Filter#on_XXX...

String#byteindex(pattern, offset = 0) -> Integer | nil (37.0)

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

...索します。

@
param pattern 探索する部分文字列または正規表現
@
param offset 探索を開始するバイト単位のオフセット

@
raise IndexError オフセットが文字列の境界以外をさしているときに発生します。

//emlist[例][ruby]{
'foo'.byteinde...
...'o', -3) # => 1
'foo'.byteindex('o', -4) # => nil

'あいう'.byteindex('う') # => 6
'あいう'.byteindex('う', 3) # => 6
'あいう'.byteindex('う', -3) # => 6
'あいう'.byteindex('う', 1) # offset 1 does not land on character boundary (IndexError)
//}

@
see String#index, String#byterindex...

Thread#ignore_deadlock=(bool) (29.0)

デッドロック検知を無視する機能をon/offします。デフォルト値はfalseです。

...デッドロック検知を無視する機能をon/offします。デフォルト値はfalseです。

trueを渡すとデッドロックを検知しなくなります。

//emlist[][ruby]{
Thread.ignore_deadlock = true
queue = Thread::Queue.new

trap(:SIGUSR1){queue.push "Received signal"}

# igno...
...re_deadlockがfalseだとエラーが発生する
puts queue.pop
//}

@
see Thread#ignore_deadlock...

CSV#field_size_limit -> Integer (19.0)

フィールドサイズの最大値を返します。

...//emlist[例][ruby]{
require "csv"

csv = CSV.new(DATA)
csv.field_size_limit # => nil
p csv.read # => [["a", "b"], ["\n2\n2\n", ""]]

DATA.rewind
csv = CSV.new(DATA, field_size_limit: 4)
p csv.field_size_limit # => 4
csv.read # => #<CSV::MalformedCSVError: Field size exceeded on line 2.>

__END__...
..."a","b"
"
2
2
",""
//}

@
see CSV.new...

絞り込み条件を変える

Encoding::InvalidByteSequenceError#error_bytes -> String (19.0)

エラー発生時に捨てられたバイト列を返します。

...ト列を返します。


//emlist[例][ruby]{
ec = Encoding::Converter.new("EUC-JP", "ISO-8859-1")
begin
ec.convert("abc\xA1\xFFdef")
rescue Encoding::InvalidByteSequenceError
p $!
#=> #<Encoding::InvalidByteSequenceError: "\xA1" followed by "\xFF" on EUC-JP>
puts $!.error_bytes.dump...
...#=> "\xA1"
puts $!.readagain_bytes.dump #=> "\xFF"
end
//}

@
see Encoding::InvalidByteSequenceError#readagain_bytes...

Pathname#binread(*args) -> String | nil (19.0)

IO.binread(self.to_s, *args)と同じです。

...ist[例][ruby]{
require "pathname"

pathname = Pathname("testfile")
pathname.binread # => "This is line one\nThis is line two\nThis is line three\nAnd so on...\n"
pathname.binread(20) # => "This is line one\nThi"
pathname.binread(20, 10) # => "ne one\nThis is line "
//}

@
see IO.bi...
<< < ... 43 44 45 >>