るりまサーチ

最速Rubyリファレンスマニュアル検索!
36件ヒット [1-36件を表示] (0.046秒)

別のキーワード

  1. _builtin hash
  2. hash []
  3. matrix hash
  4. dbm to_hash
  5. _builtin to_hash

キーワード

検索結果

pp (38157.0)

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

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

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

p による pretty-print されてない出力:
#<PP:0x81a0d10 @stack=[], @genspace=#<Proc:0x81a0cc0>, @nest=[0],...
...int::Text:0x81a0af4 @tail=0, @width=1, @text="]">], @singleli
ne_width=6>], @singleline_width=6>, @sharing_detection=false>

pp
による pretty-print された出力:
#<PP:0x40d0688
@buf=
#<PrettyPrint::Group:0x40d064c
@buf=
[#<PrettyPrint::Group:0x40d05d4
@buf=...
...などを見やすく出力するためのライブラリです。

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, @...

rexml/parsers/ultralightparser (31.0)

パース結果を配列で作られた木構造により返すパーサ。

...: [:start_element, 親ノード, 要素名, 属性, *子ノード]
XML要素。属性は { 属性名文字列 => 属性値文字列 } という Hash
子ノードの配列は node[4..-1] で得られる。
: [:text, 正規化文字列]
テキストノード
: [:processing_instruction, タ...
...DTDの属性リスト宣言。属性名とデフォルト値 は { 属性名文字列 => デフォルト値文字列(なければnil) } という Hash
: [:elementdecl, 宣言文字列]
DTDの要素宣言
: [:entitydecl, *パラメータ]
DTDの実体宣言
: [:notationdecl, 記法名文字列...
...いるので、pp の表示では省略されています。

//emlist[][ruby]{
require 'rexml/parsers/ultralightparser'
require 'pp'
parser = REXML::Parsers::UltraLightParser.new(<<XML)
<?xml version="1.0" encoding="UTF-8" ?>
<root>
<a n="1">xyz</a>
<b m="2" />
</root>
XML
pp
parser.parse
# >>...

xmlrpc (19.0)

XML-RPC を扱うためのライブラリです。

...stributed computing solutions that span
computer languages. Its distinctive feature is its simplicity compared to
other approaches like SOAP and CORBA.

The Ruby standard library package 'xmlrpc' enables you to create a server that
implements remote procedures and a client that calls them. Very li...
...andard demonstration remote procedure.

require 'xmlrpc/client'
require 'pp'

server = XMLRPC::Client.new2("http://xmlrpc-c.sourceforge.net/api/sample.php")
result = server.call("sample.sumAndDifference", 5, 3)
pp
result

=== Documentation

See http://www.ntecs.de/projects/xmlrpc4r. There...
...MLStreamParser!

* General
* possible to choose between XMLParser module (Expat wrapper) and REXML/NQXML (pure Ruby) parsers
* Marshalling Ruby objects to Hashs and reconstruct them later from a Hash
* SandStorm component architecture Client interface

=== Choosing a different XML Par...

tsort (13.0)

tsort はトポロジカルソートと強連結成分に関するモジュールを提供します。

...トポロジカルソートと強連結成分に関するモジュールを提供します。

=== Example

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

class Hash
include TSort
alias tsort_each_node each_key
def tsort_each_child(node, &block)
fetch(node).each(&block)
end
end

{1=>[2, 3], 2=>[3],...
...分に関するアルゴリズムを使っているからです。
とはいえ strongly_connected_components という正確な名前は長過ぎます。

=== References
R. E. Tarjan,
Depth First Search and Linear Graph Algorithms,
SIAM Journal on Computing, Vol. 1, No. 2, pp. 146-160, June 1972....