別のキーワード
ライブラリ
- ビルトイン (72)
-
irb
/ context (12) -
irb
/ output-method (24) -
minitest
/ unit (1) - pp (12)
- win32ole (12)
クラス
- Bignum (6)
- Fixnum (6)
-
IRB
:: Context (12) -
IRB
:: OutputMethod (24) - Integer (24)
- Module (12)
- Object (12)
- String (12)
- Thread (12)
-
WIN32OLE
_ EVENT (12)
モジュール
キーワード
- % (12)
- [] (12)
-
const
_ missing (12) - handler= (12)
-
inspect
_ mode= (12) -
mu
_ pp (1) - pp (12)
- ppx (12)
-
pretty
_ print (12) -
to
_ s (18)
検索結果
先頭5件
-
Bignum
# inspect(base = 10) -> String (18108.0) -
self を引数で指定した基数の文字列表現に変換します。
...self を引数で指定した基数の文字列表現に変換します。
@param base 基数を 2 から 36 の整数で指定します。
12345654321.to_s #=> "12345654321"
12345654321.to_s(2) #=> "1011011111110110111011110000110001"
12345654321.to_s(8) #=> "133766736... -
Fixnum
# inspect(base = 10) -> String (18108.0) -
self を引数で指定した基数の文字列表現に変換します。
...self を引数で指定した基数の文字列表現に変換します。
@param base 基数を 2 から 36 の整数で指定します。
12345.to_s #=> "12345"
12345.to_s(2) #=> "11000000111001"
12345.to_s(8) #=> "30071"
12345.to_s(10) #=> "12345"
12345.to_s(16)... -
Integer
# inspect(base=10) -> String (18108.0) -
整数を 10 進文字列表現に変換します。
...[][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 以外の数値を指定した場合に発生します。... -
IRB
:: Context # inspect _ mode=(opt) (6138.0) -
実行結果の出力方式を opt に設定します。
...します。
@param opt 以下のいずれかを指定します。
: false, :to_s, :raw
出力結果を to_s したものを表示します。
: true, :p, :inspect
出力結果を inspect したものを表示します。
: :pp, :pretty_inspect
出力結果を pretty_inspect したものを......表示します。
: :yaml, :YAML
出力結果を YAML 形式にしたものを表示します。
: :marshal, :Marshal, :MARSHAL, Marshal
出力結果を Marshal.#dump したものを表示します。
@see lib:irb#inspect_mode... -
Bignum
# to _ s(base = 10) -> String (3008.0) -
self を引数で指定した基数の文字列表現に変換します。
...self を引数で指定した基数の文字列表現に変換します。
@param base 基数を 2 から 36 の整数で指定します。
12345654321.to_s #=> "12345654321"
12345654321.to_s(2) #=> "1011011111110110111011110000110001"
12345654321.to_s(8) #=> "133766736... -
Fixnum
# to _ s(base = 10) -> String (3008.0) -
self を引数で指定した基数の文字列表現に変換します。
...self を引数で指定した基数の文字列表現に変換します。
@param base 基数を 2 から 36 の整数で指定します。
12345.to_s #=> "12345"
12345.to_s(2) #=> "11000000111001"
12345.to_s(8) #=> "30071"
12345.to_s(10) #=> "12345"
12345.to_s(16)... -
Integer
# to _ s(base=10) -> String (3008.0) -
整数を 10 進文字列表現に変換します。
...[][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 以外の数値を指定した場合に発生します。... -
IRB
:: OutputMethod # ppx(prefix , *objs) -> object (29.0) -
引数 prefix + 各 obj を inspect した文字列を self に出力し、最後に改行 を出力します。
...引数 prefix + 各 obj を inspect した文字列を self に出力し、最後に改行
を出力します。
@param prefix 各 obj の先頭に追記する文字列を指定します。
@param objs 任意のオブジェクトを指定します。... -
IRB
:: OutputMethod # pp(*objs) -> object (23.0) -
各 obj を inspect した文字列を self に出力し、最後に改行を出力します。
...各 obj を inspect した文字列を self に出力し、最後に改行を出力します。
@param objs 任意のオブジェクトを指定します。... -
MiniTest
:: Assertions # mu _ pp(object) -> String (23.0) -
Object#inspect した結果のエンコーディングを変更して返します。
...Object#inspect した結果のエンコーディングを変更して返します。
エンコーディングは Encoding.default_external に変更されます。
@param object 任意のオブジェクトを指定します。... -
Module
# const _ missing(name) (13.0) -
定義されていない定数を参照したときに Ruby インタプリタが このメソッドを呼びます。
...ッドを呼びます。
@param name 参照した定数名の Symbol
@raise NameError このメソッドを呼び出した場合、デフォルトで発生する例外
//emlist[例][ruby]{
class Foo
def Foo.const_missing(id)
warn "undefined constant #{id.inspect}"
end
Bar
end
Foo::Bar... -
Object
# pretty _ print(pp) -> () (13.0) -
PP.pp や Kernel.#pp がオブジェクトの内容を出力するときに 呼ばれるメソッドです。PP オブジェクト pp を引数として呼ばれます。
...義しています。
@param 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, Prett......を定義しています。
@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#g... -
String
# %(args) -> String (13.0) -
printf と同じ規則に従って args をフォーマットします。
...rgs が配列であれば Kernel.#sprintf(self, *args) と同じです。
それ以外の場合は Kernel.#sprintf(self, args) と同じです。
@param args フォーマットする値、もしくはその配列
@return フォーマットされた文字列
//emlist[例][ruby]{
p "i =......が String オブジェクトでなければ to_s メソッドにより文字列化
したものを引数として扱います。
: p
Object#inspect の結果を出力します。
//emlist[][ruby]{
p sprintf("%s", /e+/) #=> "(?-mix:e+)"
p sprintf("%p", /e+/) #=> "/e+/"
//}
: d
: i
引数...