るりまサーチ

最速Rubyリファレンスマニュアル検索!
551件ヒット [1-100件を表示] (0.130秒)
トップページ > クエリ:I[x] > クエリ:begin[x] > クエリ:at[x]

別のキーワード

  1. _builtin to_i
  2. fiddle to_i
  3. matrix elements_to_i
  4. matrix i
  5. _builtin i

ライブラリ

モジュール

キーワード

検索結果

<< 1 2 3 ... > >>

MatchData#begin(n) -> Integer | nil (30337.0)

n 番目の部分文字列先頭のオフセットを返します。

...nilを返します。

@param n 部分文字列を指定する数値。

@raise IndexError 範囲外の n を指定した場合に発生します。

//emlist[例][ruby]{
/(foo)(bar)(BAZ)?/ =~ "foobarbaz"
p $~.begin(0) # => 0
p $~.begin(1) # => 0
p $~.begin(2) # => 3
p $~.begin(3) # => nil...
...p $~.begin(4) # => `begin': index 4 out of matches (IndexError)
//}

@see MatchData#end...

Enumerator::ArithmeticSequence#begin -> Numeric (27201.0)

初項 (始端) を返します。

...初項 (始端) を返します。

@see Enumerator::ArithmeticSequence#end...

Enumerator::ArithmeticSequence#begin -> Numeric | nil (27201.0)

初項 (始端) を返します。

...初項 (始端) を返します。

@see Enumerator::ArithmeticSequence#end...

Exception#backtrace_locations -> [Thread::Backtrace::Location] (15406.0)

バックトレース情報を返します。Exception#backtraceに似ていますが、 Thread::Backtrace::Location の配列を返す点が異なります。

...tion#backtraceに似ていますが、
Thread::Backtrace::Location の配列を返す点が異なります。

現状では Exception#set_backtrace によって戻り値が変化する事はあり
ません。

//emlist[例: test.rb][ruby]{
require "date"
def check_long_month(month)
return if Date...
...aise "#{month} is not long month"
end

def get_exception
return begin
yield
rescue => e
e
end
end

e = get_exception { check_long_month(2) }
p e.backtrace_locations
# => ["test.rb:4:in `check_long_month'", "test.rb:15:in `block in <main>'", "test.rb:9:in `get_exception'", "test.rb:15:i...
...n `<main>'"]
//}

@see Exception#backtrace...

Array#at(nth) -> object | nil (15206.0)

nth 番目の要素を返します。nth 番目の要素が存在しない時には nil を返します。

...nth 番目の要素を返します。nth 番目の要素が存在しない時には nil を返します。

@param nth インデックスを整数で指定します。
先頭の要素が 0 番目になります。nth の値が負の時には末尾から
のインデックス...
...トを指定した場合は to_int メソッドによる
暗黙の型変換を試みます。

@raise TypeError 引数に整数以外の(暗黙の型変換が行えない)オブジェクトを
指定した場合に発生します。

//emlist[例][ruby]{
a = [ "a", "b", "...
...c", "d", "e" ]
a[0] #=> "a"
a[1] #=> "b"
a[-1] #=> "e"
a[-2] #=> "d"
a[10] #=> nil
//}...

絞り込み条件を変える

Time.httpdate(date) -> Time (9306.0)

2616で定義されているHTTP-dateとしてdateをパースして Timeオブジェクトに変換します。

...るHTTP-dateとしてdateをパースして
Timeオブジェクトに変換します。

dateが2616に準拠していない、または
Timeクラスが指定された日時を表現できないときにArgumentErrorが
発生します。

@param date 2616で定義されているHTTP-dateとして...
...ます。

@raise ArgumentError dateが2616に準拠していない、または Timeクラスが指定された日時を表現できないときに発生します。

require 'time'
rfc2616_time = 'Sun, 31 Aug 2008 12:34:56 GMT'

t = Time.httpdate(rfc2616_time)
p t.kind_of?(Time) #=> true...
...non_rfc2616_time = 'San, 31 Aug 2008 12:34:56 GMT'
begin

Time.httpdate(non_rfc2616_time)
rescue ArgumentError => err
puts err #=> not RFC 2616 compliant date: "San, 31 Aug 2008 12:34:56 GMT"
end...

SystemExit#status -> Integer (9212.0)

例外オブジェクトに保存された終了ステータスを返します。

...します。

終了ステータスは Kernel.#exit や SystemExit.new などで設定されます。

例:

begin

exit 1
rescue SystemExit => err
p err.status # => 1
end

begin

raise SystemExit.new(1, "dummy exit")
rescue SystemExit => err
p err.status # => 1
end...

PrettyPrint.format(output = &#39;&#39;, maxwidth = 79, newline = "\n", genspace = lambda{|n| &#39; &#39; * n}) {|pp| ...} -> object (9206.0)

PrettyPrint オブジェクトを生成し、それを引数としてブロックを実行します。 与えられた output を返します。

...rettyPrint オブジェクトを生成し、それを引数としてブロックを実行します。
与えられた output を返します。

以下と同じ働きをするもので簡便のために用意されています。

//emlist[][ruby]{
require 'prettyprint'

begin

pp = PrettyPrint.new...
...(output, maxwidth, newline, &genspace)
...
pp.flush
output
end
//}

@param output 出力先を指定します。output は << メソッドを持っていなければなりません。

@param maxwidth 行の最大幅を指定します。ただし、改行できないものが渡された場合...
...は、
実際の出力幅は maxwidth を越えることがあります。

@param newline 改行に使われます。

@param genspace 空白の生成に使われる Proc オブジェクトを指定します。
生成したい空白の幅を表す整数を引数と...

Thread#terminate -> self (9206.0)

スレッドの実行を終了させます。終了時に ensure 節が実行されます。

...スレッドの実行を終了させます。終了時に ensure 節が実行されます。

ただし、スレッドは終了処理中(aborting)にはなりますが、
直ちに終了するとは限りません。すでに終了している場合は何もしません。このメソッドによ...
...#exit(0)
により終了します。

Kernel.#exit と違い例外 SystemExit を発生しません。

th1 = Thread.new do
begin

sleep 10
ensure
p "this will be displayed"
end
end

sleep 0.1
th1.kill

#=> "this will be displayed"

@see Kernel.#exit, Kernel.#exit!...

Zlib::Inflate#set_dictionary(string) -> String (9112.0)

展開に用いる辞書を指定します。string を返します。 このメソッドは Zlib::NeedDict 例外が発生した直後のみ 有効です。詳細は zlib.h を参照して下さい。

...string を返します。
このメソッドは Zlib::NeedDict 例外が発生した直後のみ
有効です。詳細は zlib.h を参照して下さい。

@param string 展開に用いる辞書を文字列で指定します。

require 'zlib'

def case2(str, dict)
dez = Zlib::Deflate.new...
....set_dictionary(dict)
comp_str = dez.deflate(str)
comp_str << dez.finish
comp_str.size
i
nz = Zlib::Inflate.new
begin

i
nz.inflate(comp_str)
rescue Zlib::NeedDict
end
# 展開に用いる辞書が必要です。
i
nz.set_dictionary(dict)
p inz.inflate(comp...
..._str)
end
dict = 'hoge_fuga_ugougo'
sset = [ dict, 'taeagbamike', 'ugotagma', 'fugebogya' ]
g = [ 0, 0, 0, 1, 1, 1, 0, 0, 0, 3, 3, 3, 0, 0, 1, 1,
0, 0, 0, 1, 2, 2, 0, 0, 0, 2, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0]
str = g.collect{|m| sset.at(m)}.join("")

case2(str, dict)...

絞り込み条件を変える

File::Stat#sticky? -> bool (9106.0)

stickyビットが立っている時に真を返します。

...stickyビットが立っている時に真を返します。

//emlist[][ruby]{
Dir.glob("/usr/bin/*") {|bd|
begin

i
f File::Stat.new(bd).sticky?
puts bd
end
rescue
end
}
#例
#...
#=> /usr/bin/emacs-21.4
#...
//}...
<< 1 2 3 ... > >>