33件ヒット
[1-33件を表示]
(0.036秒)
別のキーワード
検索結果
先頭3件
-
REXML
:: Element # get _ text(path = nil) -> REXML :: Text | nil (18226.0) -
先頭のテキスト子ノードを返します。
...ください。
path を渡した場合は、その XPath 文字列で指定される
テキストノードの文字列を返します。
テキストノードがない場合には nil を返します。
@param path XPath文字列
@see REXML::Element#text
//emlist[][ruby]{
require 'rexml/documen......t'
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 # text(path = nil) -> String | nil (125.0) -
先頭のテキスト子ノードの文字列を返します。
...ださい。
path を渡した場合は、その XPath 文字列で指定される
テキストノードの文字列を返します。
テキストノードがない場合には nil を返します。
@param path XPath文字列
@see REXML::Element#get_text
//emlist[][ruby]{
require 'rexml/docume... -
cgi (84.0)
-
CGI プログラムの支援ライブラリです。
...Gateway Interface (CGI) Version 1.1
* https://www.w3.org/CGI/
=== 使用例
==== フォームフィールドの値を得る
//emlist[][ruby]{
require "cgi"
cgi = CGI.new
values = cgi['field_name'] # <== 'field_name' の配列
# 'field_name' が指定されていなかったら、 ""を返す......emlist[][ruby]{
require "cgi"
cgi = CGI.new
value = cgi.params['field_name'][0] # TempFile オブジェクト(10240バイト未満の場合は StringIOオブジェクト)
value.read # 本文(送られてきたファイルの中身)
value.local_path......ダと 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.submit...