るりまサーチ

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

別のキーワード

  1. object yield_self
  2. _builtin yield_self
  3. _builtin self
  4. tracepoint self
  5. codeobject document_self

検索結果

<< 1 2 3 ... > >>

Range#inspect -> String (18145.0)

self を文字列に変換します(始端と終端のオブジェクトは #inspect メソッド で文字列に変換されます)。

...
self
を文字列に変換します(始端と終端のオブジェクトは #inspect メソッド
で文字列に変換されます)。

@see Range#to_s

//emlist[例][ruby]{
(1..5).inspect # => "1..5"
("1".."5").inspect # => "\"1\"..\"5\""
//}...

MatchData#inspect -> String (18141.0)

self の内容を人間に読みやすい文字列にして返します。

...
self
の内容を人間に読みやすい文字列にして返します。

//emlist[例][ruby]{
puts /.$/.match("foo").inspect
# => #<MatchData "o">

puts /(.)(.)(.)/.match("foo").inspect
# => #<MatchData "foo" 1:"f" 2:"o" 3:"o">

puts /(.)(.)?(.)/.match("fo").inspect
# => #<MatchData "fo" 1:"f" 2...
...:nil 3:"o">

puts /(?<foo>.)(?<bar>.)(?<baz>.)/.match("hoge").inspect
# => #<MatchData "hog" foo:"h" bar:"o" baz:"g">
//}...

Method#inspect -> String (18135.0)

self を読みやすい文字列として返します。

...
self
を読みやすい文字列として返します。

以下の形式の文字列を返します。

#<Method: klass1(klass2)#method> (形式1)

klass1 は、Method#inspect では、レシーバのクラス名、
UnboundMethod#inspect では、UnboundMethod オブジェクト...
...# スーパークラスのクラスメソッド
class Bar < Foo
end
p Bar.method(:foo) # => #<Method: Bar.foo>

# 以下は(形式1)の出力になる
module Baz
def baz
end
end

class <<obj
include Baz
end
p obj.method(:baz) # => #<Method: Object(Baz)#baz>
//}

@see Object#inspect...
...
self
を読みやすい文字列として返します。

以下の形式の文字列を返します。

#<Method: klass1(klass2)#method(arg) foo.rb:2> (形式1)

klass1 は、Method#inspect では、レシーバのクラス名、
UnboundMethod#inspect では、UnboundMethod オブジェクト...
...ラスメソッド
class Bar < Foo
end
p Bar.method(:foo) # => #<Method: Bar(Foo).foo() foo.rb:11>

# 以下は(形式1)の出力になる
module Baz
def baz
end
end

class <<obj
include Baz
end
p obj.method(:baz) # => #<Method: String(Baz)#baz() foo.rb:23>
//}

@see Object#inspect...

UnboundMethod#inspect -> String (18135.0)

self を読みやすい文字列として返します。

...
self
を読みやすい文字列として返します。

詳しくは Method#inspect を参照してください。

//emlist[例][ruby]{
String.instance_method(:count).inspect # => "#<UnboundMethod: String#count>"
//}

@see Method#inspect...

Data#inspect -> String (18123.0)

self の内容を人間に読みやすい文字列にして返します。

...
self
の内容を人間に読みやすい文字列にして返します。

//emlist[例][ruby]{
Customer = Data.define(:name, :address, :zip)
joe = Customer.new("Joe Smith", "123 Maple, Anytown NC", 12345)
joe.inspect # => "#<data Customer name=\"Joe Smith\", address=\"123 Maple, Anytown NC\", zip...

絞り込み条件を変える

Dir#inspect -> String (18123.0)

self の情報を人間に読みやすい文字列にして返します。

...
self
の情報を人間に読みやすい文字列にして返します。

//emlist[例][ruby]{
Dir.open("/") { |d| d.inspect } # => "#<Dir:/>"
//}...

Exception#inspect -> String (18123.0)

self のクラス名と message を文字列にして返します。

...
self
のクラス名と message を文字列にして返します。

//emlist[例][ruby]{
begin
raise "exception"
rescue
p $!.inspect # => "#<RuntimeError: exception>"
end
//}...

Proc#inspect -> String (18123.0)

self の文字列表現を返します。

...
self
の文字列表現を返します。

可能なら self を生成したソースファイル名、行番号を含みます。

//emlist[例][ruby]{
p Proc.new {
true
}.to_s

# => "#<Proc:0x0x401a880c@-:3>"
//}...

RubyVM::AbstractSyntaxTree::Node#inspect -> String (18123.0)

self のデバッグ用の情報を含んだ文字列を返します。

...
self
のデバッグ用の情報を含んだ文字列を返します。

//emlist[][ruby]{
node = RubyVM::AbstractSyntaxTree.parse('1 + 1')
puts node.inspect
# => #<RubyVM::AbstractSyntaxTree::Node:SCOPE@1:0-1:5>
//}...

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

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

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

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

@see RubyVM::InstructionSequence#labe...

絞り込み条件を変える

Struct#inspect -> String (18123.0)

self の内容を人間に読みやすい文字列にして返します。

...
self
の内容を人間に読みやすい文字列にして返します。

[注意] 本メソッドの記述は Struct の下位クラスのインスタンスに対して呼び
出す事を想定しています。Struct.new は Struct の下位クラスを作成する点に
注意してくださ...
...い。

//emlist[例][ruby]{
Customer = Struct.new(:name, :address, :zip)
joe = Customer.new("Joe Smith", "123 Maple, Anytown NC", 12345)
joe.inspect # => "#<struct Customer name=\"Joe Smith\", address=\"123 Maple, Anytown NC\", zip=12345>"
//}...
<< 1 2 3 ... > >>