るりまサーチ

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

別のキーワード

  1. _builtin to_i
  2. fiddle to_i
  3. matrix elements_to_i
  4. csv to_i
  5. kernel $-i

ライブラリ

クラス

モジュール

キーワード

検索結果

<< 1 2 3 ... > >>

DateTime#offset -> Rational (21301.0)

時差を返します。

時差を返します。

MatchData#offset(name) -> [Integer, Integer] | [nil, nil] (18451.0)

name という名前付きグループに対応する部分文字列のオフセットの配列 [start, end] を返 します。

...nd] を返
します。

//emlist[例][ruby]{
[ self.begin(name), self.end(name) ]
//}

と同じです。nameの名前付きグループにマッチした部分文字列がなければ
[nil, nil] を返します。

@param name 名前(シンボルか文字列)

@raise IndexError 正規表現中で...
...//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('centu...
...ry') # => `offset': undefined group name reference: century (IndexError)
//}

@see MatchData#begin, MatchData#end...
...ry') # => `offset': undefined group name reference: century (IndexError)
//}

@see MatchData#begin, MatchData#end, MatchData#offset...

MatchData#offset(n) -> [Integer, Integer] | [nil, nil] (18416.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...
...場合に発生します。

@see MatchData#begin, MatchData#end, MatchData#offset...

Psych::SyntaxError#offset -> Integer (18323.0)

エラーが生じた位置の offset をバイト数で 返します。

...エラーが生じた位置の offset をバイト数で
返します。

offset
とは、
Psych::SyntaxError#line, Psych::SyntaxError#column
で指示される位置からの相対位置です。
この位置から 0 バイトの位置でエラーが発生することが多いため、
このメ...

VALUE rb_time_timespec_new(const struct timespec *ts, int offset) (12446.0)

引数 ts、offset を元に Time オブジェクトを作成して返します。

...offset を元に Time オブジェクトを作成して返します。

@param ts timespec 構造体のポインタ

@param offset 協定世界時との時差(秒)。
-
86400 < offset < 86400 の場合は指定した時差に、INT_MAX
を指定した場合は地方時、I...
...NT_MAX-1 を指定した場合は UTC に
なります。

@raise ArgumentError offset に上述の範囲以外の値を指定した場合に発生し
ます。...

絞り込み条件を変える

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

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

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

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

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

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

//emlist[String#byterindex の場合][ruby]{
p "stringstring".byterindex("ing", -1)...

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

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

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

引数 pattern は探索する部分文字列または正規表現で指定...
...aram offset 探索を開始するバイト単位のオフセット

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

//emlist[例][ruby]{
'foo'.byteindex('f') # => 0
'foo'.byteindex('o') # => 1
'foo'.byteindex('oo') # => 1
'foo'.byteindex...
...=> nil

'foo'.byteindex(/f/) # => 0
'foo'.byteindex(/o/) # => 1
'foo'.byteindex(/oo/) # => 1
'foo'.byteindex(/ooo/) # => nil

'foo'.byteindex('o', 1) # => 1
'foo'.byteindex('o', 2) # => 2
'foo'.byteindex('o', 3) # => nil

'foo'.byteindex('o', -1) # => 2
'foo'.byteindex('o', -2) # => 1
'foo'.byteinde...

DateTime#new_offset(offset = 0) -> DateTime (9408.0)

self を複製して、その時差を設定しなおします。 引数を省略した場合は、零 (協定世界時) になります。

...self を複製して、その時差を設定しなおします。
引数を省略した場合は、零 (協定世界時) になります。

DateTime.new も参照してください。

@param offset 時差...

Time#localtime(utc_offset) -> self (9343.0)

タイムゾーンを地方時に設定します。

...utc_offset タイムゾーンを地方時に設定する代わりに協定世界時との
時差を、秒を単位とする整数か、"+HH:MM" "-HH:MM" 形式
の文字列で指定します。

Time#localtime, Time#gmtime の挙動はシステムの
localtime(3)...
...存します。Time クラ
スでは時刻を起算時からの経過秒数として保持していますが、ある特定の
時刻までの経過秒は、システムがうるう秒を勘定するかどうかによって異
なる場合があります。システムを越えて Time オブジェ...
...

//emlist[][ruby]{
p t = Time.utc(2000, "jan", 1, 20, 15, 1) # => 2000-01-01 20:15:01 UTC
p t.utc? # => true
p t.localtime # => 2000-01-02 05:15:01 +0900
p t.utc? # => false

p t.localtime("+09:00")...

Time#gmt_offset -> Integer (9314.0)

協定世界時との時差を秒を単位とする数値として返します。

...//emlist[地方時の場合][ruby]{
p Time.now.zone # => "JST"
p Time.now.utc_offset # => 32400
//}

タイムゾーンが協定世界時に設定されている場合は 0 を返します。

//emlist[協定世界時の場合][ruby]{
p Time.now.getgm.zone # => "UTC"
p Time.now.getg...

絞り込み条件を変える

Time#utc_offset -> Integer (9314.0)

協定世界時との時差を秒を単位とする数値として返します。

...//emlist[地方時の場合][ruby]{
p Time.now.zone # => "JST"
p Time.now.utc_offset # => 32400
//}

タイムゾーンが協定世界時に設定されている場合は 0 を返します。

//emlist[協定世界時の場合][ruby]{
p Time.now.getgm.zone # => "UTC"
p Time.now.getg...
<< 1 2 3 ... > >>