るりまサーチ

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

別のキーワード

  1. _builtin -
  2. open-uri open
  3. irb/input-method new
  4. irb/input-method gets
  5. matrix -

ライブラリ

クラス

モジュール

検索結果

<< 1 2 3 ... > >>

StringScanner#rest -> String (18247.0)

文字列の残り (rest) を返します。 具体的には、スキャンポインタが指す位置からの文字列を返します。

...文字列の残り (rest) を返します。
具体的には、スキャンポインタが指す位置からの文字列を返します。

スキャンポインタが文字列の末尾を指していたら空文字列 ("") を返します。

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

s = StringScanne...
...r.new('test string')
s.rest # => "test string"
s.scan(/\w+/) # => "test"
s.rest # => " string"
s.scan(/\s+/) # => " "
s.rest # => "string"
s.scan(/\w+/) # => "string"
s.rest # => ""
//}...

StringScanner#rest_size -> Integer (6241.0)

文字列の残りの長さを返します。 stringscanner.rest.size と同じです。

...canner.rest.size と同じです。

StringScanner#restsize は将来のバージョンで削除される予定です。
代わりにStringScanner#rest_size を使ってください。

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

s = StringScanner.new('test string')
p s.rest_size # => 11
p s.rest.size #...

StringScanner#restsize -> Integer (6241.0)

文字列の残りの長さを返します。 stringscanner.rest.size と同じです。

...canner.rest.size と同じです。

StringScanner#restsize は将来のバージョンで削除される予定です。
代わりにStringScanner#rest_size を使ってください。

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

s = StringScanner.new('test string')
p s.rest_size # => 11
p s.rest.size #...

StringScanner#rest? -> bool (6225.0)

文字列が残っているならば trueを、 残っていないならば false を返します。

...します。

StringScanner#rest? は将来のバージョンで削除される予定です。
代わりに StringScanner#eos? を使ってください。

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

s = StringScanner.new('test string')
p s.eos? # => false
p s.rest? # => true
s.scan(/\w+/)...
...s.scan(/\s+/)
s.scan(/\w+/)
p s.eos? # => true
p s.rest? # => false
//}...

ruby 1.8.2 feature (4901.0)

ruby 1.8.2 feature ruby 1.8.2 での ruby 1.8.1 からの変更点です。

...ruby 1.8.2 feature
ruby
1.8.2 での ruby 1.8.1 からの変更点です。

掲載方針

*バグ修正の影響も含めて動作が変わるものを収録する。
*単にバグを直しただけのものは収録しない。
*ライブラリへの単なる定数の追加は収録しない。...
...されたクラス/メソッドなど
* [compat]: 変更されたクラス/メソッドなど
* 互換性のある変更
* only backward-compatibility
* 影響の範囲が小さいと思われる変更
* [change]: 変更されたクラス/メソッドなど(互換性のない...
...れている時に警告がでるようになりました。use #get_byte.
: StringScanner#restsize [lib] [obsolete]
$VERVOSE が設定されている時に警告がでるようになりました。use #rest_size.
: StringScanner#matchedsize [lib] [obsolete]
$VERVOSE が設定されている時...

絞り込み条件を変える

NEWS for Ruby 3.0.0 (3495.0)

NEWS for Ruby 3.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

...NEWS for Ruby 3.0.0
このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

それぞれのエントリーは参照情報があるため短いです。
十分な情報と共に書かれた全ての変更のリス...
...in Ruby 2.7 will now
result in ArgumentError or different behavior. 14183
* Procs accepting a single rest argument and keywords are no longer
subject to autosplatting. This now matches the behavior of Procs
accepting a single rest argument and no keywords.
16166

//emlist[][ruby]{...
...mlist{
def method_missing(meth, ...)
send(:"do_#{meth}", ...)
end
//}

* Pattern matching (`case/in`) is no longer experimental. 17260
* One-line pattern matching is redesigned. [EXPERIMENTAL]
* `=>` is added. It can be used like a rightward assignment.
17260
* `in...

RubyVM::AbstractSyntaxTree.of(proc) -> RubyVM::AbstractSyntaxTree::Node (3272.0)

引数 proc に渡したProcやメソッドオブジェクトの抽象構文木を返します。

...す。

//emlist[][ruby]{
pp RubyVM::AbstractSyntaxTree.of(proc {1 + 2})
# => (SCOPE@2:38-2:45
# tbl: []
# args: nil
# body:
# (OPCALL@2:39-2:44 (LIT@2:39-2:40 1) :+
# (LIST@2:43-2:44 (LIT@2:43-2:44 2) nil)))

def hello
puts "hello, world"
end

pp RubyVM::AbstractSyntaxT...
...@5:0-7:3
# tbl: []
# args:
# (ARGS@5:9-5:9
# pre_num: 0
# pre_init: nil
# opt: nil
# first_post: nil
# post_num: 0
# post_init: nil
# rest: nil
# kw: nil
# kwrest: nil
# block: nil)
# body:
# (FCALL@6:2-6:2...
...1 :puts (LIST@6:7-6:21 (STR@6:7-6:21 "hello, world") nil)))
//}...

RubyVM::AbstractSyntaxTree.of(proc, keep_script_lines: false, error_tolerant: false, keep_tokens: false) -> RubyVM::AbstractSyntaxTree::Node (3272.0)

引数 proc に渡したProcやメソッドオブジェクトの抽象構文木を返します。

...す。

//emlist[][ruby]{
pp RubyVM::AbstractSyntaxTree.of(proc {1 + 2})
# => (SCOPE@2:38-2:45
# tbl: []
# args: nil
# body:
# (OPCALL@2:39-2:44 (LIT@2:39-2:40 1) :+
# (LIST@2:43-2:44 (LIT@2:43-2:44 2) nil)))

def hello
puts "hello, world"
end

pp RubyVM::AbstractSyntaxT...
...@5:0-7:3
# tbl: []
# args:
# (ARGS@5:9-5:9
# pre_num: 0
# pre_init: nil
# opt: nil
# first_post: nil
# post_num: 0
# post_init: nil
# rest: nil
# kw: nil
# kwrest: nil
# block: nil)
# body:
# (FCALL@6:2-6:2...
...1 :puts (LIST@6:7-6:21 (STR@6:7-6:21 "hello, world") nil)))
//}...

JSON.#restore(source, proc = nil, options = {}) -> object (3216.0)

与えられた JSON 形式の文字列を Ruby オブジェクトとしてロードして返します。

...与えられた JSON 形式の文字列を Ruby オブジェクトとしてロードして返します。

proc として手続きオブジェクトが与えられた場合は、読み込んだオブジェクトを
引数にその手続きを呼び出します。


require 'json'

str=<<JSON...

Marshal.#restore(port, proc = nil) -> object (3206.0)

port からマーシャルデータを読み込んで、元のオブジェクトと同 じ状態をもつオブジェクトを生成します。

...ブジェクトが与えられた場合には読み込んだ
オブジェクトを引数にその手続きを呼び出します。

//emlist[例][ruby]{
str = Marshal.dump(["a", 1, 10 ** 10, 1.0, :foo])
p Marshal.load(str, proc {|obj| p obj})

# => "a"
# 1
# 10000000000
# 1.0
# :foo
#...

絞り込み条件を変える

RubyVM::InstructionSequence.disasm(body) -> String (3118.0)

引数 body で指定したオブジェクトから作成した RubyVM::InstructionSequence オブジェクトを人間が読める形式の文字 列に変換して返します。

...
Ruby
VM::InstructionSequence オブジェクトを人間が読める形式の文字
列に変換して返します。

@param body Proc、Method オブジェクトを指定します。

例1:Proc オブジェクトを指定した場合

# /tmp/proc.rb
p = proc { num = 1 + 2 }
puts RubyVM::I...
...== disasm: <RubyVM::InstructionSequence:block in <main>@/tmp/proc.rb>===
== catch table
| catch type: redo st: 0000 ed: 0012 sp: 0000 cont: 0000
| catch type: next st: 0000 ed: 0012 sp: 0000 cont: 0012
|------------------------------------------------------------------------
local tab...
...le (size: 2, argc: 0 [opts: 0, rest: -1, post: 0, block: -1] s1)
[ 2] num
0000 trace 1 ( 1)
0002 putobject 1
0004 putobject 2
0006 opt_plus <ic:1>
0008 dup
0009 setlocal num, 0
0012 leave

例2:M...
<< 1 2 3 ... > >>