るりまサーチ

最速Rubyリファレンスマニュアル検索!
33件ヒット [1-33件を表示] (0.148秒)
トップページ > クエリ:i[x] > クエリ:h[x] > クエリ:get_text[x]

別のキーワード

  1. _builtin to_h
  2. struct to_h
  3. hash to_h
  4. ostruct to_h
  5. env to_h

ライブラリ

クラス

キーワード

検索結果

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

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

...ださい。

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

テキストノードがない場合には nil を返します。

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

//emlist[][ruby]{
require '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 "
//}...

cgi (6060.0)

CGI プログラムの支援ライブラリです。

...CGI プログラムの支援ライブラリです。

CGI プロトコルの詳細については以下の文書を参照してください。

* https://tools.ietf.org/html/draft-coar-cgi-v11-03
* 3875: The Common Gateway Interface (CGI) Version 1.1
* https://www.w3.org/CGI/

=== 使用例

=...
...ist[][ruby]{
require "cgi"
cgi = CGI.new
values = cgi['field_name'] # <== 'field_name' の配列
# 'field_name' が指定されていなかったら、 ""を返す。
fields = cgi.keys # <== field nameの配列

# フォームに 'field_name' というfield nameがあるときに真
cgi...
... HTTP ヘッダと HTML を出力する

//emlist[][ruby]{
require "cgi"
cgi = CGI.new("html3") # HTML生成メソッドを追加
cgi.out() do
cgi.html() do
cgi.head{ cgi.title{"TITLE"} } +
cgi.body() do
cgi.form() do
cgi.textarea("get_text") +
cgi.br +
cgi.s...

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

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

...ださい。

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

テキストノードがない場合には nil を返します。

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

//emlist[][ruby]{
require 'rexml/docume...
...nt'
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 "
//}...