るりまサーチ

最速Rubyリファレンスマニュアル検索!
120件ヒット [1-100件を表示] (0.034秒)
トップページ > クエリ:method[x] > クエリ:String[x] > 種類:特異メソッド[x]

別のキーワード

  1. irb/input-method gets
  2. irb/input-method new
  3. _builtin define_method
  4. irb/input-method encoding
  5. irb/input-method readable_atfer_eof?

ライブラリ

オブジェクト

キーワード

検索結果

<< 1 2 > >>

IRB::ExtendCommandBundle.irb_original_method_name(method_name) -> String (6332.0)

method_name で指定したメソッドの irb 中でのエイリアスを返します。ライブ ラリ内部で使用します。

...
method
_name で指定したメソッドの irb 中でのエイリアスを返します。ライブ
ラリ内部で使用します。

@param method_name メソッド名を Symbol か文字列で指定します。

@see IRB::ExtendCommandBundle#install_alias_method...

main.define_method(name, method) -> Symbol (6234.0)

インスタンスメソッド name を Object に定義します。

...す。

@param name String または Symbol を指定します。

@param method Proc、Method あるいは UnboundMethod
いずれかのインスタンスを指定します。

@return メソッド名を表す Symbol を返します。

@raise TypeError method に同じクラス...
...、サブクラス以外のメソッドを指定し
た場合に発生します。


@see Module#define_method...

main.define_method(name) { ... } -> Symbol (6134.0)

インスタンスメソッド name を Object に定義します。

...す。

@param name String または Symbol を指定します。

@param method Proc、Method あるいは UnboundMethod
いずれかのインスタンスを指定します。

@return メソッド名を表す Symbol を返します。

@raise TypeError method に同じクラス...
...、サブクラス以外のメソッドを指定し
た場合に発生します。


@see Module#define_method...

JSON::Generator::GeneratorMethods::String::Extend.json_create(hash) -> String (6108.0)

JSON のオブジェクトから Ruby の文字列を生成して返します。

...のオブジェクトから Ruby の文字列を生成して返します。

@param hash キーとして "raw" という文字列を持ち、その値として数値の配列を持つハッシュを指定します。

require 'json'
String
.json_create({"raw" => [0x41, 0x42, 0x43]}) # => "ABC"...

IRB::Context.new(irb, workspace = nil, input_method = nil, output_method = nil) -> IRB::Context (221.0)

自身を初期化します。

...た場合は新しく作成されます。

@param input_method String、IRB::InputMethod のサブクラスの
オブジェクト、nil のいずれかを指定します。

@param output_method IRB::OutputMethod のサブクラスのオブジェクト...
...を指定します。省略した場合は
IRB::StdioOutputMethod オブジェクトが新しく
作成されます。...

絞り込み条件を変える

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

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

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

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

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

# /tmp/proc.rb
p = proc { num = 1 + 2 }
puts Rub...
...num, 0
0012 leave

例2:Method オブジェクトを指定した場合

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

puts RubyVM::InstructionSequence.disasm(method(:hello))

出力:

== disasm: <RubyVM::InstructionSequence:hello@/tmp/method.rb>============
0000 trace...
...( 1)
0002 trace 1 ( 2)
0004 putself
0005 putstring "hello, world"
0007 send :puts, 1, nil, 8, <ic:0>
0013 trace 16 (...

RubyVM::InstructionSequence.disassemble(body) -> String (133.0)

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

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

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

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

# /tmp/proc.rb
p = proc { num = 1 + 2 }
puts Rub...
...num, 0
0012 leave

例2:Method オブジェクトを指定した場合

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

puts RubyVM::InstructionSequence.disasm(method(:hello))

出力:

== disasm: <RubyVM::InstructionSequence:hello@/tmp/method.rb>============
0000 trace...
...( 1)
0002 trace 1 ( 2)
0004 putself
0005 putstring "hello, world"
0007 send :puts, 1, nil, 8, <ic:0>
0013 trace 16 (...

Regexp.last_match(nth) -> String | nil (108.0)

整数 nth が 0 の場合、マッチした文字列を返します ($&)。それ以外では、nth 番目の括弧にマッチ した部分文字列を返します($1,$2,...)。 対応する括弧がない場合やマッチしなかった場合には nil を返し ます。

...例外 NoMethodError が発生します。
対して、last_match(1) は nil を返します。

//emlist[例][ruby]{
str = "This is Regexp"
/That is Regexp/ =~ str
p Regexp.last_match # => nil
begin
p Regexp.last_match[1] # 例外が発生する
rescue
puts $! # => undefined method `[]' for ni...

TracePoint.new(*events) {|obj| ... } -> TracePoint (13.0)

新しい TracePoint オブジェクトを作成して返します。トレースを有効 にするには TracePoint#enable を実行してください。

...してください。

//emlist[例:irb で実行した場合][ruby]{
trace = TracePoint.new(:call) do |tp|
p [tp.lineno, tp.defined_class, tp.method_id, tp.event]
end
# => #<TracePoint:0x007f17372cdb20>

trace.enable
# => false

puts "Hello, TracePoint!"
# ...
# [69, IRB::Notifier::AbstractNoti...
...るには TracePoint#disable を実行してください。

//emlist[][ruby]{
trace.disable
//}

@param events トレースするイベントを String か Symbol で任
意の数指定します。

: :line

式の評価。

: :class

クラス定義、特異クラス定義、モ...
<< 1 2 > >>