るりまサーチ

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

別のキーワード

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

キーワード

検索結果

<< < ... 10 11 12 13 14 ... > >>

RubyVM::InstructionSequence#inspect -> String (12220.0)

self の情報をラベルとパスを含んだ人間に読みやすい文字列にして返します。

...んだ人間に読みやすい文字列にして返します。

//emlist[例][ruby]{
iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
iseq.inspect # => "<RubyVM::InstructionSequence:<compiled>@<compiled>>"
//}

@
see RubyVM::InstructionSequence#label,
Ruby
VM::InstructionSequence#path...

String#squeeze(*chars) -> String (12220.0)

chars に含まれる文字が複数並んでいたら 1 文字にまとめます。

...chars に含まれる文字が複数並んでいたら 1 文字にまとめます。

chars の形式は tr(1) と同じです。つまり、
`a-c' は a から c を意味し、"^0-9" のように
文字列の先頭が `^' の場合は指定文字以外を意味します。

`-' は文字列の両...
...引数を複数指定した場合は、すべての引数にマッチする文字を 1 文字にまとめます。

@
param chars 1文字にまとめる文字。

//emlist[例][ruby]{
p "112233445566778899".squeeze # =>"123456789"
p "112233445566778899".squeeze("2-8") # =>"11234567899"...

String#eql?(other) -> bool (12215.0)

文字列の内容が文字列 other の内容と等しいときに true を返します。 等しくなければ false を返します。

...列 other の内容と等しいときに true を返します。
等しくなければ false を返します。

このメソッドは文字列の内容を比較します。
同一のオブジェクトかどうかを比較するわけではありません。
つまり、"string".eql?(str) という...
...式を実行した場合には、
str が "string" という内容の文字列でありさえすれば常に true を返します。
同一のオブジェクトであるかどうかを判定したいときは
Object#equal? を使ってください。

アルファベットの大文字小文字を無...
...場合は
String#casecmp? を使ってください。

Hash クラス内での比較に使われます。

@
param other 任意のオブジェクト
@
return true か false

//emlist[例][ruby]{
p "string".eql?("string") # => true
p "string".eql?("STRING") # => false
p "string".eql?("")...

RubyVM::InstructionSequence#disasm -> String (12209.0)

self が表す命令シーケンスを人間が読める形式の文字列に変換して返します。

...を人間が読める形式の文字列に変換して返します。

puts RubyVM::InstructionSequence.compile('1 + 2').disasm

出力:

== disasm: <RubyVM::InstructionSequence:<compiled>@<compiled>>==========
0000 trace 1 ( 1)
0002...
...putobject 1
0004 putobject 2
0006 opt_plus <ic:1>
0008 leave

@
see RubyVM::InstructionSequence.disasm...

RubyVM::InstructionSequence#disassemble -> String (12209.0)

self が表す命令シーケンスを人間が読める形式の文字列に変換して返します。

...を人間が読める形式の文字列に変換して返します。

puts RubyVM::InstructionSequence.compile('1 + 2').disasm

出力:

== disasm: <RubyVM::InstructionSequence:<compiled>@<compiled>>==========
0000 trace 1 ( 1)
0002...
...putobject 1
0004 putobject 2
0006 opt_plus <ic:1>
0008 leave

@
see RubyVM::InstructionSequence.disasm...

絞り込み条件を変える

RubyVM::InstructionSequence#absolute_path -> String | nil (12208.0)

self が表す命令シーケンスの絶対パスを返します。

...irb で実行した場合

iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
# => <RubyVM::InstructionSequence:<compiled>@<compiled>>
iseq.absolute_path
# => nil

例2: RubyVM::InstructionSequence.compile_file を使用した場合

# /tmp/method.rb
def hello
puts "hello, wor...
...ld"
end

# irb
> iseq = RubyVM::InstructionSequence.compile_file('/tmp/method.rb')
> iseq.absolute_path # => "/tmp/method.rb"

@
see RubyVM::InstructionSequence#path...

RubyVM::InstructionSequence#base_label -> String (12208.0)

self が表す命令シーケンスの基本ラベルを返します。

...す。

例1:irb で実行した場合

iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
# => <RubyVM::InstructionSequence:<compiled>@<compiled>>
iseq.base_label
# => "<compiled>"

例2: RubyVM::InstructionSequence.compile_file を使用した場合

# /tmp/method.rb
def hello...
...lo, world"
end

# irb
> iseq = RubyVM::InstructionSequence.compile_file('/tmp/method.rb')
> iseq.base_label # => "<main>"

例3:

# /tmp/method2.rb
def hello
puts "hello, world"
end

Ruby
VM::InstructionSequence.of(method(:hello)).base_label
# => "hello"

@
see RubyVM::Instructio...

RubyVM::InstructionSequence#label -> String (12208.0)

self が表す命令シーケンスのラベルを返します。通常、メソッド名、クラス名、 モジュール名などで構成されます。

...rb で実行した場合

iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
# => <RubyVM::InstructionSequence:<compiled>@<compiled>>
iseq.label
# => "<compiled>"

例2: RubyVM::InstructionSequence.compile_file を使用した場合

# /tmp/method.rb
def hello
puts "hello, wor...
...ld"
end

# irb
> iseq = RubyVM::InstructionSequence.compile_file('/tmp/method.rb')
> iseq.label # => "<main>"

例3:

# /tmp/method2.rb
def hello
puts "hello, world"
end

Ruby
VM::InstructionSequence.of(method(:hello)).label
# => "hello"

@
see RubyVM::InstructionSequence#base_la...

RubyVM::InstructionSequence#path -> String (12208.0)

self が表す命令シーケンスの相対パスを返します。

...irb で実行した場合

iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
# => <RubyVM::InstructionSequence:<compiled>@<compiled>>
iseq.path
# => "<compiled>"

例2: RubyVM::InstructionSequence.compile_file を使用した場合

# /tmp/method.rb
def hello
puts "hello, wor...
...ld"
end

# irb
> iseq = RubyVM::InstructionSequence.compile_file('method.rb')
> iseq.path # => "method.rb"

@
see RubyVM::InstructionSequence#absolute_path...

String#sub!(pattern, replace) -> self | nil (12201.0)

文字列中で pattern にマッチした最初の部分を文字列 replace へ破壊的に置き換えます。

...文字列中で pattern にマッチした最初の部分を文字列 replace へ破壊的に置き換えます。

置換文字列 replace 中の \& と \0 はマッチした部分文字列に、
\1 ... \9 は n 番目の括弧の内容に置き換えられます。
置換文字列内では \`、\...
...します。

@
param pattern 置き換える文字列のパターンを表す文字列か正規表現。
文字列を指定した場合は全く同じ文字列にだけマッチする
@
param replace pattern で指定した文字列と置き換える文字列
@
return 置換し...
...場合は nil

//emlist[例][ruby]{
buf = "String-String"
buf.sub!(/in./, "!!")
p buf # => "Str!!-String"

buf = "String.String"
buf.sub!(/in./, '<<\&>>')
p buf # => "Str<<ing>>-String"
//}

注意:

引数 replace の中で $1 を使うことはできません。
r
eplace は sub メソッドの...

絞り込み条件を変える

<< < ... 10 11 12 13 14 ... > >>