るりまサーチ (Ruby 2.3.0)

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

別のキーワード

  1. readline output=
  2. prettyprint output
  3. irb/output-method print
  4. rake tty_output=
  5. win32ole output?

キーワード

検索結果

REXML::Output (54007.0)

出力先を wrap するクラスです。 内部用なのでユーザは使わないでください。

出力先を wrap するクラスです。
内部用なのでユーザは使わないでください。

REXML::Formatters::Default (169.0)

XMLドキュメントを(文字列として)出力するクラスです。

...列として)出力するクラスです。

REXML
::Formatters::Pretty と
異なりテキストの改行や空白を修正せずにそのまま出力します。

//emlist[][ruby]{
require 'rexml/document'
require 'rexml/formatters/default'
doc = REXML::Document.new <<EOS
<root>
<children>
<grand...
...ren>
</root>
EOS

default_formatter = REXML::Formatters::Default.new
output = StringIO.new
default_formatter.write(doc, output)
output.string
# => "<root>\n<children>\n <grandchildren/>\n</children>\n</root>\n"

output = StringIO.new
default_formatter.write(REXML::XPath.first(doc, "/root/children")...
..., output)
output.string
# => "<children>\n <grandchildren/>\n</children>"

ie_hack_formatter = REXML::Formatters::Default.new(true)
output = StringIO.new
ie_hack_formatter.write(doc, output)
output.string
# => "<root>\n<children>\n <grandchildren />\n</children>\n</root>\n"
//}...

REXML::Formatters::Transitive (133.0)

XMLドキュメントをテキストの内容を変えずに 多少の整形を加えて出力するクラスです。

...結果になるでしょう。

//emlist[][ruby]{
require 'rexml/document'
require 'rexml/formatters/transitive'
doc = REXML::Document.new <<EOS
<root><children>
<grandchildren foo='bar' />
</children></root>
EOS

transitive_formatter = REXML::Formatters::Transitive.new
output = StringIO.new
transit...
...>> <root
# >> ><children
# >> >
# >> <grandchildren foo='bar'
# >> />
# >> </children
# >> ></root
# >> >

output = StringIO.new
transitive_formatter.write(REXML::XPath.first(doc, "/root/children"), output)
output.string
# => "<children\n>\n<grandchildren foo='bar'\n />\n</children\n>"
//}...

REXML::Formatters::Pretty (61.0)

XMLドキュメントを(文字列として)見た目良く出力するクラスです。

...た目良く出力するクラスです。

REXML
::Formatters::Default と
異なり見た目のためテキストの改行や空白を修正して出力します。

//emlist[][ruby]{
require 'rexml/document'
require 'rexml/formatters/pretty'
doc = REXML::Document.new <<EOS
<root>
<children>
<gra...
...ndchildren foo='bar'/>
</children>
</root>
EOS

pretty_formatter = REXML::Formatters::Pretty.new
output = StringIO.new
pretty_formatter.write(doc, output)
output.string
# => "<root>\n <children>\n <grandchildren foo='bar'/>\n </children>\n</root>"
# この出力結果は入力のXMLよりも空...