1169件ヒット
[1-100件を表示]
(0.168秒)
ライブラリ
- ビルトイン (672)
- bigdecimal (12)
- csv (36)
- ipaddr (12)
-
irb
/ context (72) -
irb
/ ext / math-mode (8) -
irb
/ inspector (24) -
irb
/ output-method (24) - matrix (24)
-
minitest
/ unit (1) -
net
/ smtp (12) - openssl (36)
- optparse (12)
- ostruct (24)
- pp (36)
- rake (36)
-
rdoc
/ context (12) - set (14)
-
shell
/ filter (6) - socket (24)
- strscan (12)
- sync (6)
- thwait (6)
-
win32
/ registry (12) - win32ole (24)
- zlib (12)
クラス
-
ARGF
. class (24) - Addrinfo (12)
- Array (24)
- BigDecimal (12)
- Bignum (6)
- CSV (12)
-
CSV
:: Row (12) -
CSV
:: Table (12) - Complex (12)
- Data (6)
- Dir (12)
- Encoding (12)
-
Encoding
:: Converter (12) -
Enumerator
:: ArithmeticSequence (7) -
Enumerator
:: Chain (7) - Exception (12)
- FalseClass (24)
- Fixnum (6)
- Float (24)
- Hash (36)
- IPAddr (12)
-
IRB
:: Context (80) -
IRB
:: Inspector (24) -
IRB
:: OutputMethod (24) - Integer (24)
- MatchData (12)
- Matrix (12)
- Method (24)
- Module (51)
-
Net
:: SMTP (12) - Object (60)
-
OpenSSL
:: HMAC (36) - OpenStruct (24)
-
OptionParser
:: ParseError (12) - Proc (24)
-
Process
:: Status (12) -
RDoc
:: Context :: Section (12) -
Rake
:: Task (12) -
Rake
:: TaskArguments (24) - Range (24)
- Rational (24)
- Regexp (24)
-
RubyVM
:: AbstractSyntaxTree :: Node (7) -
RubyVM
:: InstructionSequence (12) - Set (20)
-
Shell
:: Filter (6) -
Socket
:: Ifaddr (12) - String (24)
- StringScanner (12)
- Struct (24)
- Symbol (12)
- Thread (42)
-
Thread
:: Backtrace :: Location (12) - ThreadsWait (6)
- Time (6)
- TracePoint (12)
- TrueClass (12)
- UnboundMethod (36)
- Vector (12)
-
WIN32OLE
_ EVENT (12) -
WIN32OLE
_ TYPE (12) -
Win32
:: Registry (12) -
Zlib
:: GzipFile :: Error (12)
モジュール
-
MiniTest
:: Assertions (1) -
Sync
_ m (6)
キーワード
- % (12)
- [] (12)
-
_ _ inspect _ _ (12) -
all
_ waits (6) -
bind
_ call (12) -
const
_ added (3) -
const
_ missing (12) -
default
_ proc (12) - handler= (12)
- hexdigest (12)
- init (12)
-
initialize
_ copy (12) - inspect? (12)
-
inspect
_ mode (12) -
inspect
_ mode= (12) -
inspect
_ sockaddr (12) -
inspect
_ value (12) - math? (4)
-
math
_ mode (4) -
mu
_ pp (1) - name (12)
- name= (10)
- pp (12)
- ppx (12)
-
pretty
_ inspect (12) -
pretty
_ print (12) -
pretty
_ print _ inspect (12) -
sync
_ inspect (6) -
to
_ s (241)
検索結果
先頭5件
-
RubyVM
:: AbstractSyntaxTree :: Node # inspect -> String (27208.0) -
self のデバッグ用の情報を含んだ文字列を返します。
...self のデバッグ用の情報を含んだ文字列を返します。
//emlist[][ruby]{
node = RubyVM::AbstractSyntaxTree.parse('1 + 1')
puts node.inspect
# => #<RubyVM::AbstractSyntaxTree::Node:SCOPE@1:0-1:5>
//}... -
Time
# inspect -> String (24244.0) -
時刻を文字列に変換した結果を返します。
...します。
Time#to_s とは異なりナノ秒まで含めて返します。
//emlist[][ruby]{
t = Time.now
t.inspect #=> "2012-11-10 18:16:12.261257655 +0100"
t.strftime "%Y-%m-%d %H:%M:%S.%N %z" #=> "2012-11-10 18:16:12.261257655 +0100"
t.utc.inspect......#=> "2012-11-10 17:16:12.261257655 UTC"
t.strftime "%Y-%m-%d %H:%M:%S.%N UTC" #=> "2012-11-10 17:16:12.261257655 UTC"
//}
戻り値の文字エンコーディングは Encoding::US_ASCII です。... -
Complex
# inspect -> String (24232.0) -
自身を人間が読みやすい形の文字列表現にして返します。
...emlist[例][ruby]{
Complex(2).inspect # => "(2+0i)"
Complex('-8/6').inspect # => "((-4/3)+0i)"
Complex('1/2i').inspect # => "(0+(1/2)*i)"
Complex(0, Float::INFINITY).inspect # => "(0+Infinity*i)"
Complex(Float::NAN, Float::NAN).inspect #... -
Object
# inspect -> String (24232.0) -
オブジェクトを人間が読める形式に変換した文字列を返します。
...の結果を使用して
オブジェクトを表示します。
//emlist[][ruby]{
[ 1, 2, 3..4, 'five' ].inspect # => "[1, 2, 3..4, \"five\"]"
Time.new.inspect # => "2008-03-08 19:43:39 +0900"
//}
inspect メソッドをオーバーライドしなかった場合、クラス名......変数の名前、値の組を元にした文字列を返します。
//emlist[][ruby]{
class Foo
end
Foo.new.inspect # => "#<Foo:0x0300c868>"
class Bar
def initialize
@bar = 1
end
end
Bar.new.inspect # => "#<Bar:0x0300c868 @bar=1>"
//}
@see Kernel.#p... -
Range
# inspect -> String (24230.0) -
self を文字列に変換します(始端と終端のオブジェクトは #inspect メソッド で文字列に変換されます)。
...self を文字列に変換します(始端と終端のオブジェクトは #inspect メソッド
で文字列に変換されます)。
@see Range#to_s
//emlist[例][ruby]{
(1..5).inspect # => "1..5"
("1".."5").inspect # => "\"1\"..\"5\""
//}... -
MatchData
# inspect -> String (24226.0) -
self の内容を人間に読みやすい文字列にして返します。
...ist[例][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
# => #<Match......Data "hog" foo:"h" bar:"o" baz:"g">
//}... -
Rational
# inspect -> String (24226.0) -
自身を人間が読みやすい形の文字列表現にして返します。
...に10進数の表記を返します。
@return 有理数の表記にした文字列を返します。
//emlist[例][ruby]{
Rational(5, 8).inspect # => "(5/8)"
Rational(2).inspect # => "(2/1)"
Rational(-8, 6).inspect # => "(-4/3)"
Rational(0.5).inspect # => "(1/2)"
//}
@see Rational#to_s... -
String
# inspect -> String (24226.0) -
文字列オブジェクトの内容を、出力したときに人間が読みやすいような適当な形式に変換します。 変換された文字列は印字可能な文字のみによって構成されます
...ために用意されています。
永続化などの目的で文字列をダンプしたいときは、
String#dump を使うべきです。
//emlist[例][ruby]{
# p ではないことに注意
puts "string".inspect # => "string"
puts "\t\r\n".inspect # => "\t\r\n"
//}
@see String#dump... -
StringScanner
# inspect -> String (24226.0) -
StringScannerオブジェクトを表す文字列を返します。
...StringScannerオブジェクトを表す文字列を返します。
文字列にはクラス名の他、以下の情報が含まれます。
* スキャナポインタの現在位置。
* スキャン対象の文字列の長さ。
* スキャンポインタの前後にある文字。......//emlist[例][ruby]{
require 'strscan'
s = StringScanner.new('test string')
s.inspect # => "#<StringScanner 0/11 @ \"test ...\">"
s.scan(/\w+/) # => "test"
s.inspect # => "#<StringScanner 4/11 \"test\" @ \" stri...\">"
s.......scan(/\s+/) # => " "
s.inspect # => "#<StringScanner 5/11 \"test \" @ \"strin...\">"
s.scan(/\w+/) # => "string"
s.inspect # => "#<StringScanner fin>"
//}... -
Method
# inspect -> String (24220.0) -
self を読みやすい文字列として返します。
...します。
以下の形式の文字列を返します。
#<Method: klass1(klass2)#method> (形式1)
klass1 は、Method#inspect では、レシーバのクラス名、
UnboundMethod#inspect では、UnboundMethod オブジェクトの生成
元となったクラス/モジュ......モジュール名、
method は、メソッド名を表します。
//emlist[例][ruby]{
module Foo
def foo
"foo"
end
end
class Bar
include Foo
def bar
end
end
p Bar.new.method(:foo) # => #<Method: Bar(Foo)#foo>
p Bar.new.method(:bar) # => #<Method: Bar#bar>
//}
klass......が同じ場合は以下の形式になります。
#<Method: klass1#method> (形式2)
特異メソッドに対しては、
#<Method: obj.method> (形式3)
#<Method: klass1(klass2).method> (形式4)
という形式の文字列......します。
以下の形式の文字列を返します。
#<Method: klass1(klass2)#method(arg) foo.rb:2> (形式1)
klass1 は、Method#inspect では、レシーバのクラス名、
UnboundMethod#inspect では、UnboundMethod オブジェクトの生成
元となったクラス/モジ......しているクラス/モジュール名、
method は、メソッド名を表します。
arg は引数を表します。
「foo.rb:2」は Method#source_location を表します。
source_location が nil の場合には付きません。
//emlist[例][ruby]{
module Foo
def foo
"foo"
e......def bar(a, b)
end
end
p Bar.new.method(:foo) # => #<Method: Bar(Foo)#foo() test.rb:2>
p Bar.new.method(:bar) # => #<Method: Bar#bar(a, b) test.rb:8>
//}
klass1 と klass2 が同じ場合は以下の形式になります。
#<Method: klass1#method() foo.rb:2> (形式2)...