種類
ライブラリ
- ビルトイン (782)
- bigdecimal (11)
- csv (33)
- ipaddr (11)
-
irb
/ context (77) -
irb
/ ext / math-mode (8) -
irb
/ inspector (77) -
irb
/ output-method (22) - matrix (22)
-
minitest
/ unit (1) -
net
/ smtp (11) - openssl (33)
- optparse (11)
- ostruct (33)
- pp (33)
- rake (33)
-
rdoc
/ context (11) - set (18)
- shell (6)
-
shell
/ filter (6) - socket (33)
- strscan (11)
- sync (6)
- thwait (24)
-
win32
/ registry (11) - win32ole (22)
- zlib (11)
クラス
-
ARGF
. class (22) - Addrinfo (22)
- Array (22)
- BigDecimal (11)
- Bignum (6)
- CSV (11)
-
CSV
:: Row (11) -
CSV
:: Table (11) - 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)
- IPAddr (11)
-
IRB
:: Context (85) -
IRB
:: Inspector (44) -
IRB
:: OutputMethod (22) - Integer (22)
- MatchData (11)
- Matrix (11)
- Method (22)
- Module (46)
-
Net
:: SMTP (11) - Object (55)
-
OpenSSL
:: HMAC (33) - OpenStruct (33)
-
OptionParser
:: ParseError (11) - Proc (22)
-
Process
:: Status (11) -
RDoc
:: Context :: Section (11) -
Rake
:: Task (11) -
Rake
:: TaskArguments (22) - Range (22)
- Rational (22)
- Regexp (22)
-
RubyVM
:: AbstractSyntaxTree :: Node (6) -
RubyVM
:: InstructionSequence (11) - Set (18)
- Shell (6)
-
Shell
:: Filter (6) -
Socket
:: Ifaddr (11) - String (22)
- StringScanner (11)
- Struct (22)
- Symbol (11)
- Thread (38)
-
Thread
:: Backtrace :: Location (11) - ThreadsWait (24)
- Time (5)
- TracePoint (11)
- TrueClass (11)
- UnboundMethod (32)
- Vector (11)
-
WIN32OLE
_ EVENT (11) -
WIN32OLE
_ TYPE (11) -
Win32
:: Registry (11) -
Zlib
:: GzipFile :: Error (11)
モジュール
- IRB (11)
- Kernel (121)
-
MiniTest
:: Assertions (1) -
Sync
_ m (6)
キーワード
- % (11)
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (11) - INSPECTORS (11)
- InspectKey (11)
- Inspector (22)
-
NEWS for Ruby 2
. 0 . 0 (11) -
NEWS for Ruby 2
. 3 . 0 (9) -
NEWS for Ruby 2
. 5 . 0 (7) -
NEWS for Ruby 2
. 7 . 0 (5) -
NO
_ INSPECTING _ IVARS (11) - Numeric (11)
- Thread (11)
- [] (11)
-
_ _ inspect _ _ (11) - ` (11)
- abort (22)
-
all
_ waits (18) -
bind
_ call (10) - cgi (11)
-
const
_ added (2) -
const
_ missing (11) - debug= (6)
-
def
_ inspector (11) -
default
_ proc (11) -
drb
/ gw (11) - exit (11)
- format (11)
- handler= (11)
- hexdigest (11)
- init (11)
-
initialize
_ copy (11) - inspect? (11)
-
inspect
_ i (11) -
inspect
_ mode (11) -
inspect
_ mode= (11) -
inspect
_ obj (11) -
inspect
_ sockaddr (11) -
inspect
_ value (11) - irb (11)
-
irb
/ completion (11) -
irb
/ ext / math-mode (4) -
irb
/ inspector (11) -
keys
_ with _ inspector (11) - math? (4)
-
math
_ mode (4) -
method
_ inspect (11) -
mu
_ pp (1) - name (11)
- name= (9)
- new (17)
- p (11)
- pp (11)
- ppx (11)
-
pretty
_ inspect (11) -
pretty
_ print (11) -
pretty
_ print _ inspect (11) -
rb
_ inspect (11) -
rb
_ obj _ inspect (11) -
rb
_ thread _ inspect (11) -
ruby 1
. 6 feature (11) -
ruby 1
. 8 . 2 feature (11) -
ruby 1
. 8 . 4 feature (11) -
ruby 1
. 8 . 5 feature (11) -
ruby 1
. 9 feature (11) - sprintf (11)
- sprintf フォーマット (11)
-
sync
_ inspect (6) -
to
_ s (231) -
trace
_ var (33) -
untrace
_ var (11) - クラス/メソッドの定義 (11)
- スレッド (11)
検索結果
先頭5件
-
Object
# initialize _ copy(obj) -> object (6.0) -
(拡張ライブラリによる) ユーザ定義クラスのオブジェクトコピーの初期化メソッド。
...//emlist[][ruby]{
obj = Object.new
class <<obj
attr_accessor :foo
def bar
:bar
end
end
def check(obj)
puts "instance variables: #{obj.inspect}"
puts "tainted?: #{obj.tainted?}"
print "singleton methods: "
begin
p obj.bar
rescue NameError
p $!
end
end
obj.foo = 1
obj.t......//emlist[][ruby]{
obj = Object.new
class <<obj
attr_accessor :foo
def bar
:bar
end
end
def check(obj)
puts "instance variables: #{obj.inspect}"
print "singleton methods: "
begin
p obj.bar
rescue NameError
p $!
end
end
obj.foo = 1
check Object.new.send(:initialize_copy,... -
Object
# pretty _ print(pp) -> () (6.0) -
PP.pp や Kernel.#pp がオブジェクトの内容を出力するときに 呼ばれるメソッドです。PP オブジェクト pp を引数として呼ばれます。
...ブジェクトです。
//emlist[][ruby]{
require 'pp'
class Array
def pretty_print(q)
q.group(1, '[', ']') {
q.seplist(self) {|v|
q.pp v
}
}
end
end
//}
@see Object#pretty_print_cycle, Object#inspect, PrettyPrint#text, PrettyPrint#group, PrettyPrint#breakable......@param pp PP オブジェクトです。
//emlist[][ruby]{
class Array
def pretty_print(q)
q.group(1, '[', ']') {
q.seplist(self) {|v|
q.pp v
}
}
end
end
//}
@see Object#pretty_print_cycle, Object#inspect, PrettyPrint#text, PrettyPrint#group, PrettyPrint#breakable... -
Range
# to _ s -> String (6.0) -
self を文字列に変換します(始端と終端のオブジェクトは #to_s メソッドで文 字列に変換されます)。
...self を文字列に変換します(始端と終端のオブジェクトは #to_s メソッドで文
字列に変換されます)。
@see Range#inspect
//emlist[例][ruby]{
(1..5).to_s # => "1..5"
("1".."5").to_s # => "1..5"
//}... -
Rational
# to _ s -> String (6.0) -
自身を人間が読みやすい形の文字列表現にして返します。
..."-17/7" のように10進数の表記を返します。
@return 有理数の表記にした文字列を返します。
//emlist[例][ruby]{
Rational(3, 4).to_s # => "3/4"
Rational(8).to_s # => "8/1"
Rational(-8, 6).to_s # => "-4/3"
Rational(0.5).to_s # => "1/2"
//}
@see Rational#inspect... -
Regexp
# to _ s -> String (6.0) -
正規表現の文字列表現を生成して返します。返される文字列は他の正規表 現に埋め込んでもその意味が保持されるようになっています。
...emlist[][ruby]{
re = /(foo|bar)\1/ # \1 は、foo か bar
p /(baz)#{re}/ # \1 は、baz
# => /(baz)(?-mix:(foo|bar)\1)/
//}
//emlist[使用例][ruby]{
re = /foo|bar|baz/i
p re.to_s # => "(?i-mx:foo|bar|baz)"
p /#{re}+/o # => /(?i-mx:foo|bar|baz)+/
//}
@see Regexp#inspect... -
Shell
. debug=(val) (6.0) -
デバッグ用のフラグを設定します。
...デバッグ用のフラグを設定します。
@param val bool 値や整数値を指定します。詳細は下記を参照してください。
# debug: true -> normal debug
# debug: 1 -> eval definition debug
# debug: 2 -> detail inspect debug... -
String
# %(args) -> String (6.0) -
printf と同じ規則に従って args をフォーマットします。
...が String オブジェクトでなければ to_s メソッドにより文字列化
したものを引数として扱います。
: p
Object#inspect の結果を出力します。
//emlist[][ruby]{
p sprintf("%s", /e+/) #=> "(?-mix:e+)"
p sprintf("%p", /e+/) #=> "/e+/"
//}
: d
: i
引数... -
Thread (6.0)
-
スレッドを表すクラスです。スレッドとはメモリ空間を共有して同時に実行される制御の流れです。 Thread を使うことで並行プログラミングが可能になります。
...照して下さい。
=== スレッドの状態
個々のスレッドは、以下の実行状態を持ちます。これらの状態は
Object#inspect や
Thread#status によって見ることができます。
p Thread.new {sleep 1} # => #<Thread:0xa039de0 sleep>
: run (実行or実行可能... -
Thread
# [](name) -> object | nil (6.0) -
name に対応したスレッドに固有のデータを取り出します。 name に対応するスレッド固有データがなければ nil を返し ます。
...name"] = "A" },
Thread.new { Thread.current[:name] = "B" },
Thread.new { Thread.current["name"] = "C" }
].each do |th|
th.join
puts "#{th.inspect}: #{th[:name]}"
end
# => #<Thread:0x00000002a54220 dead>: A
# => #<Thread:0x00000002a541a8 dead>: B
# => #<Thread:0x00000002a54130 dead>: C
//}... -
Thread
# name=(name) -> String (6.0) -
self の名前を name に設定します。
...数に ASCII 互換ではないエンコーディングのものを
指定した場合に発生します。
//emlist[例][ruby]{
a = Thread.new{}
a.name = 'named'
a.name # => "named"
a.inspect # => "#<Thread:0x00007f85ac8721f0@named@(irb):1 dead>"
//}
@see Thread#name...