36件ヒット
[1-36件を表示]
(0.017秒)
種類
- インスタンスメソッド (12)
- ライブラリ (12)
- 文書 (12)
ライブラリ
- prettyprint (12)
クラス
- PrettyPrint (12)
キーワード
- pp (12)
- クラス/メソッドの定義 (12)
検索結果
-
PrettyPrint
# nest(indent) { . . . } -> () (21101.0) -
自身の現在のインデントを indent だけ増加させてから、ブロックを実行し、元に戻します。
自身の現在のインデントを indent だけ増加させてから、ブロックを実行し、元に戻します。
@param indent インデントの増加分を整数で指定します。 -
クラス/メソッドの定義 (52.0)
-
クラス/メソッドの定義 * クラス/メソッドの定義: * class * singleton_class * module * method * operator * nest_method * eval_method * singleton_method * class_method * limit * 定義に関する操作: * alias * undef * defined
...ス/メソッドの定義
* クラス/メソッドの定義:
* class
* singleton_class
* module
* method
* operator
* nest_method
* eval_method
* singleton_method
* class_method
* limit
* 定義に関する操作:
* alias
* undef
* defined......][ruby]{
def foo(cnt, &block_arg)
cnt.times { block_arg.call } # ブロックに収まったProcオブジェクトはcallで実行
end
foo(3) { print "Ruby! " } #=> Ruby! Ruby! Ruby!
//}
メソッド定義において、仮引数はその種類毎に以下の順序でしか指定すること
は......ではありませんが、まれにOS(シェル)のコ
マンド実行の挙動に不具合がある場合などに利用できます。
====[a:nest_method] メソッド定義のネスト
ネスト可能です。ネストされた定義式は、
それを定義したメソッドが実行された... -
pp (48.0)
-
オブジェクトなどを見やすく出力するためのライブラリです。
...か?
p による pretty-print されてない出力:
#<PP:0x81a0d10 @stack=[], @genspace=#<Proc:0x81a0cc0>, @nest=[0], @newline="\n",
@buf=#<PrettyPrint::Group:0x81a0c98 @group=0, @tail=0, @buf=[#<PrettyPrint::Gro
up:0x81a0ba8 @group=1, @tail=0, @buf=[#<PrettyPrint::Text:0x81a0b30 @tail=2, @......wi
dth=1, @text="[">, #<PrettyPrint::Group:0x81a0a68 @group=2, @tail=1, @buf=[#<Pre
ttyPrint::Text:0x81a09f0 @tail=1, @width=1, @text="1">], @singleline_width=1>, #
<PrettyPrint::Text:0x81a0a7c @tail=0, @width=1, @text=",">, #<PrettyPrint::Break
able:0x81a0a2c @group=2, @gensace=#<Proc:0x81a......Print::Group:0x81a09c8 @group=2, @tail=1, @
buf=[#<PrettyPrint::Text:0x81a0950 @tail=1, @width=1, @text="2">], @singleline_w
idth=1>, #<PrettyPrint::Text:0x81a0af4 @tail=0, @width=1, @text="]">], @singleli
ne_width=6>], @singleline_width=6>, @sharing_detection=false>
pp による pretty-print...