るりまサーチ

最速Rubyリファレンスマニュアル検索!
33件ヒット [1-33件を表示] (0.082秒)
トップページ > クエリ:-[x] > クエリ:size[x] > クエリ:hash[x] > クエリ:pp[x]

別のキーワード

  1. _builtin size
  2. _builtin size?
  3. net/imap size
  4. rexml/document size
  5. file size

ライブラリ

キーワード

検索結果

pp (38174.0)

オブジェクトなどを見やすく出力するためのライブラリです。

...このライブラリを require すると Kernel.#pp が定義されます。
Kernel.#p のかわりに Kernel.#pp を使うことにより、
適切にインデントと改行された分かりやすい出力を得ることが出来ます。
pp
ライブラリは、ユーザがあたらしく定...
...表示を
するように作られていますので、Kernel.#pp を使う上で余計な作業をする
必要はありません。

=== どちらが読みやすいでしょうか?

p による pretty-print されてない出力:
#<PP:0x81a0d10 @stack=[], @genspace=#<Proc:0x81a0cc0>, @nest=[0],...
...します。

PP
は PrettyPrint のサブクラスですので、上で PrettyPrint のメソッドとされているものは
PP
のメソッドでもあります。

以下は Hash の pretty printing のカスタマイズの例です。

//emlist[][ruby]{
require 'pp'

class Hash
def pretty_pr...
...などを見やすく出力するためのライブラリです。

pp
ライブラリは、ユーザがあたらしく定義したクラスに対しても見やすい表示を
するように作られていますので、Kernel.#pp を使う上で余計な作業をする
必要はありません。...
...=== どちらが読みやすいでしょうか?

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, @...
...宜挿入します。

PP
は PrettyPrint のサブクラスですので、上で PrettyPrint のメソッドとされているものは
PP
のメソッドでもあります。

以下は Hash の pretty printing のカスタマイズの例です。

//emlist[][ruby]{
class Hash
def pretty_print(q...

NEWS for Ruby 3.0.0 (372.0)

NEWS for Ruby 3.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

...a=>1}, {}]
//}

* Arguments forwarding (`...`) now supports leading arguments.
16378

//emlist{
def method_missing(meth, ...)
send(:"do_#{meth}", ...)
end
//}

* Pattern matching (`case/in`) is no longer experimental. 17260
* One-line pattern matching is redesigned. [EXPERIMENTAL]...
...on-blocking context. 16786
* Dir
* Dir.glob and Dir.[] now sort the results by default, and accept the `sort:` keyword option. 8709
* ENV
* ENV.except has been added, which returns a hash excluding the given keys and their values. 15822
* Windows: Read ENV names and values as UTF-8...
...per-`Thread`. This change should be compatible for essentially all usages and avoids blocking when using a scheduler. 16792
* Proc
* Proc#== and Proc#eql? are now defined and will return true for separate Proc instances if the procs were created from the same block. 14267
* Queue / SizedQue...

NEWS for Ruby 2.5.0 (168.0)

NEWS for Ruby 2.5.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

...は参照情報があるため短いです。
十分な情報と共に書かれた全ての変更のリストは ChangeLog ファイルか bugs.ruby-lang.org の issue を参照してください。

== 2.4.0 以降の変更

=== 言語仕様の変更

* トップレベルの定数参照を削除...
...黙の to_s 呼び出しにも refinements が影響するようになりました 13812

=== 組み込みクラスの更新

* Array
* Array#append を追加 12746
* Array#prepend を追加 12746

* Data
* 非推奨になりました。C拡張のベースクラスでしたが、Ruby...
...ime, File.lstat はGVLを解放するようになりました
* File.lutime を追加 4052

* Hash
* Hash#transform_keys を追加 13583
* Hash#transform_keys! を追加 13583
* Hash#slice を追加 8499

* IO
* IO.copy_stream は copy_file_range(2) を使うようになり...

RubyVM::InstructionSequence#to_a -> Array (142.0)

self の情報を 14 要素の配列にして返します。

...トを示す数値。常に 1。

: misc

以下の要素から構成される Hash オブジェクト。

:arg_size: メソッド、ブロックが取る引数の総数(1 つもない場合は 0)。

:local_size: ローカル変数の総数 + 1。

:stack_max: スタックの深さ。...
...列の配列。


//emlist[例][ruby]{
require 'pp'

iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
pp
iseq.to_a
# ※ Ruby 2.5.0 での実行結果
# => ["YARVInstructionSequence/SimpleDataFormat",
# 2,
# 0,
# 1,
# {:arg_size=>0, :local_size=>2, :stack_max=>2},
# "<compiled>",
# "<compil...