61件ヒット
[1-61件を表示]
(0.075秒)
ライブラリ
- pp (24)
- prettyprint (37)
クラス
- Object (12)
- PP (12)
- PrettyPrint (37)
キーワード
-
comma
_ breakable (12) - first? (1)
- group (12)
-
pretty
_ print (12)
検索結果
先頭5件
-
PrettyPrint
# text(obj) -> () (35103.0) -
obj を width カラムのテキストとして自身に追加します。
obj を width カラムのテキストとして自身に追加します。
@param obj 自身に追加するテキストを文字列で指定します。
@param width obj のカラムを指定します。指定されなかった場合、obj.length が利用されます。 -
PrettyPrint
# text(obj , width = obj . length) -> () (35103.0) -
obj を width カラムのテキストとして自身に追加します。
obj を width カラムのテキストとして自身に追加します。
@param obj 自身に追加するテキストを文字列で指定します。
@param width obj のカラムを指定します。指定されなかった場合、obj.length が利用されます。 -
PrettyPrint
# group(indent = 0 , open _ obj = & # 39;& # 39; , close _ obj = & # 39;& # 39; , open _ width = open _ obj . length , close _ width = close _ obj . length) { . . . } -> () (17013.0) -
与えられたブロックを実行します。 ブロック内で自身に追加される文字列やオブジェクトは、1行にまとめて表示しても よい同じグループに属すると仮定されます。
...は、1行にまとめて表示しても
よい同じグループに属すると仮定されます。
もう少し詳しく説明します。pretty printing アルゴリズムはインデントと改行を、
ツリー構造を作ることによって決定します。そして、group メソッド......param open_obj 指定された場合、self.text(open_obj, open_width) がブロックが
実行される前に呼ばれます。開き括弧などを出力するのに使用されます。
@param close_obj 指定された場合、self.text(close_obj, close_width) がブロックが... -
PrettyPrint
# first? -> bool (17007.0) -
このメソッドは obsolete です。
...の呼び出しかどうかを判定する
述語です。これはカンマで区切られた値を整形するのに有用です。
pp.group(1, '[', ']') {
xxx.each {|yyy|
unless pp.first?
pp.text ','
pp.breakable
end
... pretty printing yyy ...
}
}... -
PP
# comma _ breakable -> () (35.0) -
以下と等価な働きをするもので簡便のために用意されています。 //emlist[][ruby]{ text ',' breakable //}
...以下と等価な働きをするもので簡便のために用意されています。
//emlist[][ruby]{
text ','
breakable
//}
@see PrettyPrint#text, PrettyPrint#breakable... -
Object
# pretty _ print(pp) -> () (25.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...