672件ヒット
[1-100件を表示]
(0.164秒)
種類
- インスタンスメソッド (552)
- モジュール関数 (66)
- 特異メソッド (43)
- クラス (11)
クラス
-
ARGF
. class (22) - Array (22)
- Bignum (6)
- Complex (11)
- Data (4)
- Dir (11)
- Encoding (11)
-
Encoding
:: Converter (11) -
Enumerator
:: ArithmeticSequence (6) -
Enumerator
:: Chain (6) - Exception (11)
- FalseClass (22)
- Fixnum (6)
- Float (22)
- Hash (33)
- Integer (22)
- MatchData (11)
- Method (22)
- Module (33)
- Object (22)
- Proc (22)
-
Process
:: Status (11) - Range (11)
- Rational (11)
- Regexp (22)
-
RubyVM
:: AbstractSyntaxTree :: Node (6) -
RubyVM
:: InstructionSequence (11) - String (22)
- Struct (22)
- Symbol (11)
- Thread (29)
-
Thread
:: Backtrace :: Location (11) - Time (15)
- TracePoint (11)
- TrueClass (11)
- UnboundMethod (22)
モジュール
- Kernel (66)
キーワード
- % (11)
- Numeric (11)
- [] (11)
-
default
_ proc (11) - format (11)
-
initialize
_ copy (11) - name (11)
- new (8)
- now (2)
- sprintf (11)
-
to
_ s (158) -
trace
_ var (33) -
untrace
_ var (11)
検索結果
先頭5件
-
Integer
# inspect(base=10) -> String (41427.0) -
整数を 10 進文字列表現に変換します。
...文字列表
現に変換します。
//emlist[][ruby]{
p 10.to_s(2) # => "1010"
p 10.to_s(8) # => "12"
p 10.to_s(16) # => "a"
p 35.to_s(36) # => "z"
//}
@return 数値の文字列表現
@param base 基数となる 2 - 36 の数値。
@raise ArgumentError base に 2 - 36 以外の数... -
String
# inspect -> String (41421.0) -
文字列オブジェクトの内容を、出力したときに人間が読みやすいような適当な形式に変換します。 変換された文字列は印字可能な文字のみによって構成されます
...ために用意されています。
永続化などの目的で文字列をダンプしたいときは、
String#dump を使うべきです。
//emlist[例][ruby]{
# p ではないことに注意
puts "string".inspect # => "string"
puts "\t\r\n".inspect # => "\t\r\n"
//}
@see String#dump... -
Encoding
# inspect -> String (41415.0) -
プログラマにわかりやすい表現の文字列を返します。
...プログラマにわかりやすい表現の文字列を返します。
//emlist[例][ruby]{
Encoding::UTF_8.inspect #=> "#<Encoding:UTF-8>"
Encoding::ISO_2022_JP.inspect #=> "#<Encoding:ISO-2022-JP (dummy)>"
//}... -
TracePoint
# inspect -> String (41415.0) -
self の状態を人間に読みやすい文字列にして返します。
...self の状態を人間に読みやすい文字列にして返します。
//emlist[例][ruby]{
def foo(ret)
ret
end
trace = TracePoint.new(:call) do |tp|
p tp.inspect # "#<TracePoint:call `foo'@/path/to/test.rb:1>"
end
trace.enable
foo 1
//}... -
RubyVM
:: InstructionSequence # inspect -> String (41409.0) -
self の情報をラベルとパスを含んだ人間に読みやすい文字列にして返します。
...んだ人間に読みやすい文字列にして返します。
//emlist[例][ruby]{
iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
iseq.inspect # => "<RubyVM::InstructionSequence:<compiled>@<compiled>>"
//}
@see RubyVM::InstructionSequence#label,
RubyVM::InstructionSequence#path... -
Encoding
:: Converter # inspect -> String (41403.0) -
Encoding::Converter オブジェクトの情報を簡単に表示します。
...Encoding::Converter オブジェクトの情報を簡単に表示します。
@return 変換器の情報を簡単に可視化した文字列です。... -
Enumerator
:: Chain # inspect -> String (41403.0) -
self を人間が読みやすい形式で文字列として返します。
self を人間が読みやすい形式で文字列として返します。 -
main
. inspect -> "main" (41403.0) -
"main" を返します。
..."main" を返します。... -
Complex
# inspect -> String (38469.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 #......=> "(NaN+NaN*i)"
//}... -
Method
# inspect -> String (38457.0) -
self を読みやすい文字列として返します。
...式の文字列を返します。
#<Method: klass1(klass2)#method> (形式1)
klass1 は、Method#inspect では、レシーバのクラス名、
UnboundMethod#inspect では、UnboundMethod オブジェクトの生成
元となったクラス/モジュール名です。
klass2......ュール名、
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>
//}
klass1 と......クトになります。
//emlist[例][ruby]{
# オブジェクトの特異メソッド
obj = ""
class <<obj
def foo
end
end
p obj.method(:foo) # => #<Method: "".foo>
# クラスメソッド(クラスの特異メソッド)
class Foo
def Foo.foo
end
end
p Foo.method(:foo) # => #<M......の文字列を返します。
#<Method: klass1(klass2)#method(arg) foo.rb:2> (形式1)
klass1 は、Method#inspect では、レシーバのクラス名、
UnboundMethod#inspect では、UnboundMethod オブジェクトの生成
元となったクラス/モジュール名です。
klass2......thod#source_location を表します。
source_location が nil の場合には付きません。
//emlist[例][ruby]{
module Foo
def foo
"foo"
end
end
class Bar
include Foo
def bar(a, b)
end
end
p Bar.new.method(:foo) # => #<Method: Bar(Foo)#foo() test.rb:2>
p Bar.new.method(......になります。
//emlist[例][ruby]{
# オブジェクトの特異メソッド
obj = ""
class <<obj
def foo
end
end
p obj.method(:foo) # => #<Method: "".foo() foo.rb:4>
# クラスメソッド(クラスの特異メソッド)
class Foo
def Foo.foo
end
end
p Foo.method(:foo) # =...