るりまサーチ

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

別のキーワード

  1. fiddle ruby_free
  2. rbconfig ruby
  3. fiddle build_ruby_platform
  4. rake ruby
  5. rubygems/defaults ruby_engine

ライブラリ

クラス

キーワード

検索結果

<< 1 2 > >>

REXML::Element#text(path = nil) -> String | nil (33462.0)

先頭のテキスト子ノードの文字列を返します。

...クセスできないことに注意してください。

r
aw モードの設定は無視され、常に正規化されたテキストを返します。
R
EXML::Text#value も参照してください。

path を渡した場合は、その XPath 文字列で指定される
テキストノードの...
...返します。

@param path XPath文字列
@see REXML::Element#get_text

//emlist[][ruby]{
r
equire 'rexml/document'
doc = REXML::Document.new "<p>some text <b>this is bold!</b> more text</p>"
# doc.root (<p> ... </p>) は2つのテキストノード("some text " と " more text"
# を持ってい...
...るが、前者を返す
doc.root.text # => "some text "
//}...

URI::MailTo#to_rfc822text -> String (27474.0)

URI オブジェクトからメールテキスト文字列を生成します。

...URI オブジェクトからメールテキスト文字列を生成します。

例:
r
equire 'uri'
p mailto = URI.parse("mailto:ruby-list@ruby-lang.org?subject=subscribe&cc=myaddr")
print mailto.to_mailtext

=> #<URI::MailTo:0x20104a0e URL:mailto:ruby-list@ruby-lang.org?subject=subscribe&...
...cc=myaddr>
T
o: ruby-list@ruby-lang.org
Subject: subscribe
Cc: myaddr...

URI::MailTo#to_mailtext -> String (24474.0)

URI オブジェクトからメールテキスト文字列を生成します。

...URI オブジェクトからメールテキスト文字列を生成します。

例:
r
equire 'uri'
p mailto = URI.parse("mailto:ruby-list@ruby-lang.org?subject=subscribe&cc=myaddr")
print mailto.to_mailtext

=> #<URI::MailTo:0x20104a0e URL:mailto:ruby-list@ruby-lang.org?subject=subscribe&...
...cc=myaddr>
T
o: ruby-list@ruby-lang.org
Subject: subscribe
Cc: myaddr...

REXML::Element#text=(text) (21703.0)

「先頭の」テキストノードを text で置き換えます。

... text で置き換えます。

テキストノードを1つ以上保持している場合はそのうち
最初のノードを置き換えます。

要素がテキストノードを保持していない場合は新たなテキストノードが追加されます。

text
には文字列、REXML::T...
...ext、nil のいずれかが指定できます。
R
EXML::Text オブジェクトを指定した場合には、それが設定され、
文字列を指定した場合には
R
EXML::Text.new(text, whitespace(), nil, raw())
で生成される Text オブジェクトが設定されます。
nil を指定...
...@param text 置き換え後のテキスト(文字列、REXML::Text, nil(削除))

//emlist[][ruby]{
r
equire 'rexml/document'
doc = REXML::Document.new('<a><b/></a>')
doc.to_s # => "<a><b/></a>"
doc.root.text = "Foo"; doc.to_s # => "<a><b/>Foo</a>"
doc.root.text = "Bar"; doc.to_s # => "<a><b/>Bar</a...

REXML::Element#get_text(path = nil) -> REXML::Text | nil (21663.0)

先頭のテキスト子ノードを返します。

...先頭のテキスト子ノードを返します。

r
aw モードの設定は無視され、常に正規化されたテキストを返します。
R
EXML::Text#value も参照してください。

path を渡した場合は、その XPath 文字列で指定される
テキストノードの文字...
...を返します。

@param path XPath文字列
@see REXML::Element#text

//emlist[][ruby]{
r
equire 'rexml/document'
doc = REXML::Document.new "<p>some text <b>this is bold!</b> more text</p>"
# doc.root (<p> ... </p>) は2つのテキストノード("some text " と " more text"
# を持っている...
...が、前者を返す
doc.root.get_text.value # => "some text "
//}...

絞り込み条件を変える

REXML::Element#each_element_with_text(text = nil, max = 0, name = nil) {|element| ... } -> () (21557.0)

テキストを子ノードとして 持つすべての子要素を引数としてブロックを呼び出します。

...クを呼び出します。

text
を指定すると、テキストの内容が text であるもののみを対象とします。
maxを指定すると、対象となる子要素の先頭 max 個のみが対象となります。
name を指定すると、それは xpath 文字列と見なされ、...
...)。

@param text テキストの中身(文字列)
@param max ブロック呼出の対象とする子要素の最大個数
@param name xpath文字列

//emlist[][ruby]{
r
equire 'rexml/document'
doc = REXML::Document.new '<a><b>b</b><c>b</c><d>d</d><e/></a>'
doc.root.each_element_with_text {|e|p e}
#...
...>> <b> ... </>
# >> <c> ... </>
# >> <d> ... </>
doc.root.each_element_with_text('b'){|e|p e}
# >> <b> ... </>
# >> <c> ... </>
doc.root.each_element_with_text('b', 1){|e|p e}
# >> <b> ... </>
doc.root.each_element_with_text(nil, 0, 'd'){|e|p e}
# >> <d> ... </>
//}...

IRB::Context#prompt_mode -> Symbol (18213.0)

現在のプロンプトモードを Symbol で返します。

...そうでない場合は、:DEFAULT、:CLASSIC、:SIMPLE、:INF_RUBY、:XMP、:NULL
のいずれかを返します。

定義済みのプロンプトモードの内容については、IRB.conf[:PROMPT][mode] を
参照してください。

@see IRB::Context#prompt_mode=, lib:irb#customize_prompt...

IRB::Context#prompt_mode=(mode) (18213.0)

プロンプトモードを mode に設定します。

...@param mode プロンプトモードを Symbol で指定します。オリジナルの
プロンプトモードか、:DEFAULT、:CLASSIC、:SIMPLE、:INF_RUBY
:XMP、:NULL のいずれを指定してください。

@see IRB::Context#prompt_mode, lib:irb#customize_prompt...

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

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

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

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

@see REXML::Text#value

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