るりまサーチ

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

別のキーワード

  1. kernel spawn
  2. kernel system
  3. kernel exec
  4. kernel open
  5. kernel gsub

ライブラリ

クラス

キーワード

検索結果

ARGF.class#puts(*arg) -> nil (21114.0)

引数と改行を順番に処理対象のファイルに出力します。 引数がなければ改行のみを出力します。

...力します。
引数がなければ改行のみを出力します。

c:ARGF#inplace時にのみ使用できます。
また $stdout への代入の影響を受けません。
それ以外は Kernel.#puts と同じです。

@param arg 出力するオブジェクトを任意個指定します。...

Method#owner -> Class | Module (148.0)

このメソッドが定義されている class か module を返します。

...定義されている class か module を返します。

//emlist[例][ruby]{
class
Foo
def foo(arg)
"foo called with arg #{arg}"
end
end

m = Foo.new.method(:foo) # => #<Method: Foo#foo>
m.owner # => Foo

m = Foo.new.method(:puts) # => #<Method: Foo(Kernel)#puts>
m.owner # => Kernel
//}...

Object#to_s -> String (55.0)

オブジェクトの文字列表現を返します。

...

Kernel
.#print や Kernel.#sprintf は文字列以外の
オブジェクトが引数に渡された場合このメソッドを使って文字列に変換し
ます。

//emlist[][ruby]{
class
Foo
def initialize num
@num = num
end
end
it = Foo.new(40)

puts
it #=> #<Foo:0x2b69110>

class
Foo...
...def to_s
"Class:Foo Number:#{@num}"
end
end

puts
it #=> Class:Foo Number:40
//}

@see Object#to_str,Kernel.#String...

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

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

...表すフレームを 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

# => pat...