111件ヒット
[1-100件を表示]
(0.129秒)
ライブラリ
-
cgi
/ core (11) -
irb
/ context (22) - pp (22)
- prettyprint (34)
- uri (22)
クラス
- CGI (11)
-
IRB
:: Context (22) - Object (22)
- PrettyPrint (34)
-
URI
:: MailTo (22)
キーワード
- first? (1)
- group (11)
- header (11)
-
pretty
_ print (11) -
pretty
_ print _ cycle (11) -
return
_ format (11) -
return
_ format= (11) -
to
_ mailtext (11) -
to
_ rfc822text (11)
検索結果
先頭5件
-
PrettyPrint
# text(obj) -> () (21103.0) -
obj を width カラムのテキストとして自身に追加します。
obj を width カラムのテキストとして自身に追加します。
@param obj 自身に追加するテキストを文字列で指定します。
@param width obj のカラムを指定します。指定されなかった場合、obj.length が利用されます。 -
PrettyPrint
# text(obj , width = obj . length) -> () (21103.0) -
obj を width カラムのテキストとして自身に追加します。
obj を width カラムのテキストとして自身に追加します。
@param obj 自身に追加するテキストを文字列で指定します。
@param width obj のカラムを指定します。指定されなかった場合、obj.length が利用されます。 -
Object
# pretty _ print _ cycle(pp) -> () (6136.0) -
プリティプリント時にオブジェクトの循環参照が検出された場合、 Object#pretty_print の代わりに呼ばれるメソッドです。
...t#pretty_print の代わりに呼ばれるメソッドです。
あるクラスの pp の出力をカスタマイズしたい場合は、
このメソッドも再定義する必要があります。
@param pp PP オブジェクトです。
//emlist[][ruby]{
class Array
def pretty_print_cycle(q)......q.text(empty? ? '[]' : '[...]')
end
end
//}
@see Object#pretty_print... -
Object
# pretty _ print(pp) -> () (6132.0) -
PP.pp や Kernel.#pp がオブジェクトの内容を出力するときに 呼ばれるメソッドです。PP オブジェクト pp を引数として呼ばれます。
...します。
そのとき pretty_print メソッドは指定された pp に対して表示したい自身の内容を追加して
いかなければいけません。いくつかの組み込みクラスについて、
pp ライブラリはあらかじめ pretty_print メソッドを定義してい......ブジェクトです。
//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... -
URI
:: MailTo # to _ mailtext -> String (6108.0) -
URI オブジェクトからメールテキスト文字列を生成します。
...字列を生成します。
例:
require 'uri'
p mailto = URI.parse("mailto:ruby-list@ruby-lang.org?subject=subscribe&cc=myaddr")
print mailto.to_mailtext
=> #<URI::MailTo:0x20104a0e URL:mailto:ruby-list@ruby-lang.org?subject=subscribe&cc=myaddr>
To: ruby-list@ruby-lang.org
Subj... -
URI
:: MailTo # to _ rfc822text -> String (6108.0) -
URI オブジェクトからメールテキスト文字列を生成します。
...字列を生成します。
例:
require 'uri'
p mailto = URI.parse("mailto:ruby-list@ruby-lang.org?subject=subscribe&cc=myaddr")
print mailto.to_mailtext
=> #<URI::MailTo:0x20104a0e URL:mailto:ruby-list@ruby-lang.org?subject=subscribe&cc=myaddr>
To: ruby-list@ruby-lang.org
Subj... -
PrettyPrint
# group(indent = 0 , open _ obj = & # 39;& # 39; , close _ obj = & # 39;& # 39; , open _ width = open _ obj . length , close _ width = close _ obj . length) { . . . } -> () (3013.0) -
与えられたブロックを実行します。 ブロック内で自身に追加される文字列やオブジェクトは、1行にまとめて表示しても よい同じグループに属すると仮定されます。
...、1行にまとめて表示しても
よい同じグループに属すると仮定されます。
もう少し詳しく説明します。pretty printing アルゴリズムはインデントと改行を、
ツリー構造を作ることによって決定します。そして、group メソッドは......param open_obj 指定された場合、self.text(open_obj, open_width) がブロックが
実行される前に呼ばれます。開き括弧などを出力するのに使用されます。
@param close_obj 指定された場合、self.text(close_obj, close_width) がブロックが... -
IRB
:: Context # return _ format -> String (3007.0) -
irb のプロンプトでの評価結果を表示する際のフォーマットを文字列で返します。
...irb のプロンプトでの評価結果を表示する際のフォーマットを文字列で返します。
@see IRB::Context#return_format=, print_format... -
IRB
:: Context # return _ format=(val) (3007.0) -
irb のプロンプトでの評価結果を表示する際のフォーマットに val を設定します。
...irb のプロンプトでの評価結果を表示する際のフォーマットに val を設定します。
@see IRB::Context#return_format, print_format
IRB::Context#prompt_mode の変更に影響を受ける事に注意してください。... -
PrettyPrint
# first? -> bool (3007.0) -
このメソッドは obsolete です。
...の呼び出しかどうかを判定する
述語です。これはカンマで区切られた値を整形するのに有用です。
pp.group(1, '[', ']') {
xxx.each {|yyy|
unless pp.first?
pp.text ','
pp.breakable
end
... pretty printing yyy ...
}
}...