るりまサーチ

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

別のキーワード

  1. kernel require
  2. getoptlong require_order
  3. rubygems/custom_require require
  4. irb/ext/use-loader irb_require
  5. rdoc/require require

ライブラリ

クラス

モジュール

キーワード

検索結果

Net::HTTPResponse#entity -> String | () | nil (18220.0)

エンティティボディを返します。

...ます。

Net::HTTPResponse#read_body をブロック付きで呼んだ場合には
このメソッドはNet::ReadAdapter のインスタンスを返しますが、
これは使わないでください。

entity
は obsolete です。

//emlist[例][ruby]{
require
'net/http'

uri = "http://www.exa...
...mple.com/index.html"
r
esponse = Net::HTTP.get_response(URI.parse(uri))
r
esponse.body[0..10] # => "<!doctype h"
//}...

REXML::StreamListener#entitydecl(content) -> () (12161.0)

DTDの実体宣言をパースしたときに呼び出されるコールバックメソッドです。

...aram content 実体宣言が配列で渡されます

実体宣言の書き方によって content に渡されるデータの形式が異なります。

//emlist[][ruby]{
require
'rexml/parsers/baseparser'
require
'rexml/parsers/streamparser'
require
'rexml/streamlistener'
xml = <<EOS
<!DOCTYPE ro...
...ot [
<!ENTITY % YN '"Yes"'>
<!ENTITY % YN 'Yes'>
<!ENTITY WhatHeSaid "He said %YN;">
<!ENTITY open-hatch SYSTEM "http://www.textuality.com/boilerplate/OpenHatch.xml">
<!ENTITY open-hatch PUBLIC "-//Textuality//TEXT Standard open-hatch boilerplate//EN" "http://www.textuality.com/boilerplate/OpenHatch...
....xml">
<!ENTITY hatch-pic SYSTEM "../grafix/OpenHatch.gif" NDATA gif>
]>
<root />
EOS

class Listener
include REXML::StreamListener
def entitydecl(content); p content; end
end
R
EXML::Parsers::StreamParser.new(xml, Listener.new).parse
# >> ["YN", "\"Yes\"", "%"]
# >> ["YN", "Yes", "%"]
# >> ["Wha...

REXML::DocType#write(output, indent = 0, transitive = false, ie_hack = false) -> () (6125.0)

output に DTD を出力します。

...ソッドは deprecated です。REXML::Formatter
出力してください。

@param output 出力先の IO オブジェクト
@param indent インデントの深さ。指定しないでください。
@param transitive 無視されます。指定しないでください。
@param ie_hack 無...
...[][ruby]{
require
'rexml/document'

doctype = REXML::Document.new(<<EOS).doctype
<!DOCTYPE books [
<!ELEMENT book (comment)>
<!ELEMENT comment (#PCDATA)>
<!ATTLIST book
author CDATA #REQUIRED
title CDATA #REQUIRED
publisher CDATA "foobar publisher">
<!ENTITY p "foobar p...
...ublisher">
<!ENTITY % q "quzz">
]>
EOS

doctype.write(STDOUT)
# =>
# <!DOCTYPE books [
# <!ELEMENT book (comment)>
# ....
//}...

Net::HTTPResponse#body -> String | () | nil (3120.0)

エンティティボディを返します。

...ます。

Net::HTTPResponse#read_body をブロック付きで呼んだ場合には
このメソッドはNet::ReadAdapter のインスタンスを返しますが、
これは使わないでください。

entity
は obsolete です。

//emlist[例][ruby]{
require
'net/http'

uri = "http://www.exa...
...mple.com/index.html"
r
esponse = Net::HTTP.get_response(URI.parse(uri))
r
esponse.body[0..10] # => "<!doctype h"
//}...

REXML::Text#to_s -> String (3119.0)

テキストの内容を正規化(すべての実体をエスケープ)された状態で返します。

...トとして妥当です。

結果は REXML::Text.new で指定した entity_filter を反映しています。

@see REXML::Text#value

//emlist[][ruby]{
require
'rexml/document'
t = REXML::Text.new("< & foobar", false, nil, false)
t.to_s # => "&lt; &amp; foobar"
t.value # => "< & foobar"
//}...

絞り込み条件を変える

REXML::Text#value -> String (3119.0)

テキストの内容を非正規化(すべての実体をアンエスケープ)された状態で返します。

...

このメソッドの返り値では raw モードや entity_filter は無視されます。

@see REXML::Text#raw, REXML::Text#to_s

//emlist[][ruby]{
require
'rexml/document'
t = REXML::Text.new("< & foobar", false, nil, false)
t.to_s # => "&lt; &amp; foobar"
t.value # => "< & foobar"
//}...