るりまサーチ

最速Rubyリファレンスマニュアル検索!
66件ヒット [1-66件を表示] (0.057秒)
トップページ > クエリ:|[x] > クエリ:-[x] > クエリ:skip[x] > 種類:インスタンスメソッド[x]

別のキーワード

  1. _builtin |
  2. set |
  3. ipaddr |
  4. array |
  5. integer |

ライブラリ

キーワード

検索結果

StringScanner#skip(regexp) -> Integer | nil (18333.0)

スキャンポインタの地点だけで regexp と文字列のマッチを試します。 マッチしたらスキャンポインタを進めマッチした部分文字列の 長さを返します。マッチしなかったら nil を返します。

...を返します。

@param regexp マッチに使用する正規表現を指定します。

//emlist[例][ruby]{
require 'strscan'

s = StringScanner.new('test string')
p s.skip(/\w+/) #=> 4
p s.skip(/\w+/) #=> nil
p s.skip(/\s+/) #=> 1
p s.skip(/\w+/) #=> 6
p s.skip(/./) #=> nil
//}...

StringScanner#skip_until(regexp) -> Integer | nil (6303.0)

regexp が一致するまで文字列をスキャンします。 マッチに成功したらスキャンポインタを進めて、 スキャン開始位置からマッチ部分の末尾までの部分文字列の長さを返します。 マッチに失敗したら nil を返します。

regexp が一致するまで文字列をスキャンします。
マッチに成功したらスキャンポインタを進めて、
スキャン開始位置からマッチ部分の末尾までの部分文字列の長さを返します。
マッチに失敗したら nil を返します。

@param regexp マッチに使用する正規表現を指定します。

//emlist[例][ruby]{
require 'strscan'

s = StringScanner.new('test string')
s.scan_until(/str/) # => 8
s.matched # => "str"
s.pos # =>...

Thread::Backtrace::Location#absolute_path -> String (125.0)

self が表すフレームの絶対パスを返します。

...返します。

//emlist[例][ruby]{
# foo.rb
class Foo
attr_accessor :locations
def initialize(skip)
@locations = caller_locations(skip)
end
end

Foo.new(0..2).locations.map do |call|
puts call.absolute_path
end

# => /path/to/foo.rb
# /path/to/foo.rb
# /path/to/foo.rb
//}

@see Thread...

Thread::Backtrace::Location#base_label -> String (125.0)

self が表すフレームの基本ラベルを返します。通常、 Thread::Backtrace::Location#label から修飾を取り除いたもので構成 されます。

...されます。

//emlist[例][ruby]{
# foo.rb
class Foo
attr_accessor :locations
def initialize(skip)
@locations = caller_locations(skip)
end
end

Foo.new(0..2).locations.map do |call|
puts call.base_label
end

# => initialize
# new
# <main>
//}

@see Thread::Backtrace::Location#label...

Thread::Backtrace::Location#inspect -> String (125.0)

Thread::Backtrace::Location#to_s の結果を人間が読みやすいような文 字列に変換したオブジェクトを返します。

...返します。

//emlist[例][ruby]{
# foo.rb
class Foo
attr_accessor :locations
def initialize(skip)
@locations = caller_locations(skip)
end
end

Foo.new(0..2).locations.map do |call|
puts call.inspect
end

# => "path/to/foo.rb:5:in `initialize'"
# "path/to/foo.rb:9:in `new'"
# "path/t...

絞り込み条件を変える

Thread::Backtrace::Location#to_s -> String (125.0)

self が表すフレームを Kernel.#caller と同じ表現にした文字列を返し ます。

...返し
ます。

//emlist[例][ruby]{
# foo.rb
class Foo
attr_accessor :locations
def initialize(skip)
@locations = caller_locations(skip)
end
end

Foo.new(0..2).locations.map do |call|
puts call.to_s
end

# => path/to/foo.rb:5:in `initialize'
# path/to/foo.rb:9:in `new'
# path/to/foo.r...