るりまサーチ

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

別のキーワード

  1. object yield_self
  2. _builtin yield_self
  3. _builtin self
  4. tracepoint self
  5. codeobject document_self

ライブラリ

クラス

キーワード

検索結果

<< 1 2 > >>

REXML::Element#root -> REXML::Element (18165.0)

self が属する文書のルート要素を返します。

...self が属する文書のルート要素を返します。

//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new(<<EOS)
<root>
<children>
<grandchildren />
</children>
</root>
EOS

children = doc.get_elements("/root/children").first
children.name # => "children"
children.root.name...
...# => "root"
grandchildren = doc.get_elements("/root/children/grandchildren").first
grandchildren.name # => "grandchildren"
grandchildren.root.name # => "root"
//}...

REXML::Element#root_node -> REXML::Document | REXML::Node (6153.0)

self が属する文書のルートノードを返します。

...self が属する文書のルートノードを返します。

通常はその要素が属する文書(REXML::Document) オブジェクトが
返されます。

その要素が属する REXML::Document オブジェクトが存在しない
場合は木構造上のルートノードが返されま...
...ument'
doc = REXML::Document.new(<<EOS)
<root>
<children>
<grandchildren />
</children>
</root>
EOS

children = doc.get_elements("/root/children").first
children.name # => "children"
children.root_node == doc # => true
grandchildren = doc.get_elements("/root/children/grandchildren").first
grandchi...
...ldren.name # => "grandchildren"
grandchildren.root_node == doc # => true
//}...

Pathname#root? -> bool (6129.0)

self がルートディレクトリであれば真を返します。判断は文字列操作によっ て行われ、ファイルシステムはアクセスされません。

...self がルートディレクトリであれば真を返します。判断は文字列操作によっ
て行われ、ファイルシステムはアクセスされません。

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

Pathname('/').root? # => true
Pathname('/im/sure').root? # => false
//}...

REXML::Element#delete_namespace(namespace = "xmlns") -> self (113.0)

名前空間を要素から削除します。

...除します。

@param namespace 削除する名前空間の prefix

//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new "<a xmlns:foo='bar' xmlns='twiddle'/>"
doc.root.delete_namespace
doc.to_s # => "<a xmlns:foo='bar'/>"
doc.root.delete_namespace 'foo'
doc.to_s # => "<a/>"
//}...

REXML::Attributes#prefixes -> [String] (46.0)

self の中で宣言されている prefix の集合を 文字列の配列で返します。

...self の中で宣言されている prefix の集合を
文字列の配列で返します。

self
が属する要素より上位の要素で定義されているものは含みません。

//emlist[][ruby]{
require 'rexml/document'

doc = REXML::Document.new(<<EOS)
<root xmlns:foo="http://example....
...org/foo"
xmlns:bar="http://example.org/bar">
<a foo:att='1' bar:att='2' att='&lt;'/>
</root>
EOS
a = doc.get_elements("/root/a").first

p doc.root.attributes.prefixes # => ["foo", "bar"]
p a.attributes.prefixes # => []
//}...

絞り込み条件を変える

REXML::Attributes#namespaces -> { String => String } (40.0)

self の中で宣言されている名前空間の集合を返します。

...self の中で宣言されている名前空間の集合を返します。

返り値は名前空間の prefix をキーとし、URI を値とする
Hash を返します。

//emlist[][ruby]{
require 'rexml/document'

doc = REXML::Document.new(<<EOS)
<root xmlns:foo="http://example.org/foo"
xm...
...lns:bar="http://example.org/bar">
<a foo:att='1' bar:att='2' att='&lt;'/>
</root>
EOS
a = doc.get_elements("/root/a").first

p doc.root.attributes.namespaces
# => {"foo"=>"http://example.org/foo", "bar"=>"http://example.org/bar"}
p a.attributes.namespaces
# => {}
//}...

REXML::Text.new(arg, respect_whitespace = false, parent = nil, raw = nil, entity_filter = nil, illegal = REXML::Text::NEEDS_A_SECOND_CHECK) (30.0)

テキストノードオブジェクトを生成します。

...含まれているすべての(定義済み)実体を
エスケープします
nilの場合、親ノードが raw モードであるかどうかで
self
が raw モードになるかどうかが決まります。
arg に REXML::Text オブジェクトを渡した場合は、この値は無視され...
...= REXML::Document.new(<<EOS)
doctype = REXML::Document.new(<<EOS).doctype
<!DOCTYPE root [
<!ENTITY p "foobar publisher">
<!ENTITY % q "quzz">
]>
<root />
EOS
REXML::Text.new("&quzz", false, doc.root, false).to_s # => "&amp;&q;"
REXML::Text.new("quzz", false, doc.root, true).to_s # => "quzz"
//}...

REXML::Attributes#delete(attribute) -> REXML::Element (24.0)

指定した属性を取り除きます。

...ジェクトを指定します

self
が属する要素(REXML::Element)を返します。

@param attribute 取り除く属性(文字列もしくは REXML::Attribute オブジェクト)

//emlist[][ruby]{
require 'rexml/document'

doc = REXML::Document.new(<<-EOS)
<root xmlns:foo="http://example.org...
.../foo"
xmlns:bar="http://example.org/bar">
<a foo:att='1' bar:att='2' att='&lt;'/>
</root>
EOS
a = doc.get_elements("/root/a").first

a.attributes.delete("att") # => <a foo:att='1' bar:att='2'/>
a.attributes.delete("foo:att") # => <a bar:att='2'/>
attr = a.attributes.get_attribute("bar:at...

REXML::Element#has_elements? -> bool (22.0)

self が一つでも子要素を持つならば true を返します。

...self が一つでも子要素を持つならば true を返します。

//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new("<a><b/><c>Text</c></a>")
doc.root.has_elements? # => true
doc.elements["/a/b"].has_elements? # => false
# /a/c はテキストノードしか...

ReFe (18.0)

ReFe ReFeについては http://i.loveruby.net/ja/prog/refe.html をご覧ください。

...

tar xvzf refe-x.x.x.tar.gz
cd refe-x.x.x
ruby setup.rb config
ruby setup.rb setup
(必要に応じて root になってください)
ruby setup.rb install

(2) http://www.ruby-lang.org/ja/man/man-rd-ja.tar.gz
にあるのが最新のリファ...
...REFE_DATA_DIR を設定する必要があります)

gzip -dc man-rd-ja.tar.gz | tar xvf -
cd man-rd-ja
(必要に応じて root になってください)
mkrefe_rubyrefm -d /usr/local/share/refe *.rd

/usr/local/share/refe 下に以下のディレクトリとフ...
...method_document_comp

(4) 後は使うだけです。

refe IO puts
IO#puts
--- puts([obj[, ...]])

各 obj を self に出力した後、改行します。
引数の扱いは puts と同じです(詳細はこちらを参照し
てくだ...

絞り込み条件を変える

<< 1 2 > >>