るりまサーチ

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

別のキーワード

  1. openssl p
  2. openssl p=
  3. fileutils mkdir_p
  4. kernel p
  5. kernel $-p

検索結果

<< 1 2 > >>

REXML::DocType#entity(name) -> String | nil (27238.0)

name という実体参照名を持つ実体を文字列で返します。

...EXML::Entity#unnormalized 参照)
された文字列が返されます。

name という名前を持つ実体が存在しない場合には nil を返します。

@param name 実体参照名(文字列)

//emlist[][ruby]{
doctype = REXML::Document.new(<<EOS).doctype
<!DOCTYPE foo [
<!ENTITY bar "...
...barbarbarbar">
]>
EOS
p
doctype.entity("bar") # => "barbarbar"
p
doctype.entity("foo") # => nil
//}...

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

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

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

entity
は obsolete です。

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

uri = "http://www.example.com/i...
...ndex.html"
response = Net::HTTP.get_response(URI.parse(uri))
response.body[0..10] # => "<!doctype h"
//}...

Hash#compare_by_identity -> self (18331.0)

ハッシュのキーの一致判定をオブジェクトの同一性で判定するように変更します。

...

//emlist[例][ruby]{
h1 = { "a" => 100, "b" => 200, :c => "c" }
p
h1.compare_by_identity? #=> false
p
h1["a"] #=> 100

h1.compare_by_identity

p
h1.compare_by_identity? #=> true
p
h1["a"] #=> nil # この"a"と最初の"a"とは違うオブジェクト
p
h1[:c] #=> "c" #...
...同じ内容のシンボルはすべて同一
//}

@see Hash#compare_by_identity?...

Hash#compare_by_identity? -> bool (18313.0)

ハッシュがキーの一致判定をオブジェクトの同一性を用いて行っているならば真を返します。

...ハッシュがキーの一致判定をオブジェクトの同一性を用いて行っているならば真を返します。

//emlist[例][ruby]{
h1 = {}
p
h1.compare_by_identity? #=> false

h1.compare_by_identity

p
h1.compare_by_identity? #=> true
//}

@see Hash#compare_by_identity...

REXML::Parsers::PullEvent#entitydecl? -> bool (15201.0)

DTDの実体宣言なら真を返します。

DTDの実体宣言なら真を返します。

絞り込み条件を変える

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

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

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

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

//emlist[][ruby]{
require 'rexml/parsers/baseparser'
require 'rexml/parsers/streamparser'
require 'rexml/streamlistener'
xml = <<EOS
<!DOCTYPE...
...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
REXML::Parsers::StreamParser.new(xml, Listener.new).parse
# >> ["YN", "\"Yes\"", "%"]
# >> ["YN", "Yes", "%"]
# >> ["Wha...

REXML::Entity#pubid -> String | nil (12101.0)

公開識別子(public identifier)を用いた外部実体宣言の場合は、その公開識別子を 返します。

...公開識別子(public identifier)を用いた外部実体宣言の場合は、その公開識別子を
返します。

それ以外の場合は nil を返します。...

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

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

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

entity
は obsolete です。

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

uri = "http://www.example.com/i...
...ndex.html"
response = Net::HTTP.get_response(URI.parse(uri))
response.body[0..10] # => "<!doctype h"
//}...

REXML::DocType#entities -> { String => REXML::Entity } (6256.0)

DTD で宣言されている実体の集合を Hash で返します。

...::Entity オブジェクト
を値とするハッシュテーブルです。

これには、XML のデフォルトの実体(gt, lt, quot, apos)も含まれています。

//emlist[][ruby]{
doctype = REXML::Document.new(<<EOS).doctype
<!DOCTYPE foo [
<!ENTITY bar "barbarbarbar">
]>
EOS

p
doctype...
....entities # => { "gt" => #<REXML::Entity: ...>,
# "lt" => #<REXML::Entity: ...>, ... }
p
doctype.entities["bar"].to_s # => "<!ENTITY bar \"barbarbarbar\">"
p
doctype.entities["gt"].to_s # => "<!ENTITY gt \">\">"
//}...
<< 1 2 > >>