474件ヒット
[1-100件を表示]
(0.153秒)
ライブラリ
- ビルトイン (102)
-
cgi
/ core (12) -
irb
/ context (48) -
net
/ http (36) - open-uri (48)
- pp (24)
-
rexml
/ document (156) -
rexml
/ streamlistener (12) - uri (24)
-
webrick
/ httprequest (12)
クラス
- CGI (12)
-
Enumerator
:: Yielder (6) -
IRB
:: Context (48) - Method (14)
- Object (24)
-
ObjectSpace
:: WeakMap (12) -
REXML
:: CData (24) -
REXML
:: Element (72) -
REXML
:: Instruction (24) -
REXML
:: Text (36) - String (70)
-
URI
:: MailTo (24) -
WEBrick
:: HTTPRequest (12)
モジュール
-
Net
:: HTTPHeader (36) -
OpenURI
:: Meta (48) -
REXML
:: StreamListener (12)
キーワード
- +@ (10)
- -@ (10)
- << (7)
- >> (7)
- []= (12)
- charset (24)
- content (12)
-
content
_ type (24) - dedup (3)
-
each
_ element _ with _ text (12) - encode (36)
- entitydecl (12)
-
get
_ text (12) -
has
_ elements? (12) - header (12)
-
main
_ type (12) -
next
_ element (12) -
pretty
_ print (12) -
pretty
_ print _ cycle (12) -
prompt
_ mode (12) -
prompt
_ mode= (12) - query (12)
-
sub
_ type (12) - target (12)
- text= (12)
-
to
_ mailtext (12) -
to
_ proc (6) -
to
_ rfc822text (12) -
to
_ s (24) -
unicode
_ normalize! (11) -
use
_ readline (12) -
use
_ readline? (12) - value (24)
- value= (12)
検索結果
先頭5件
-
REXML
:: Element # text(path = nil) -> String | nil (24256.0) -
先頭のテキスト子ノードの文字列を返します。
...:Text#value も参照してください。
path を渡した場合は、その XPath 文字列で指定される
テキストノードの文字列を返します。
テキストノードがない場合には nil を返します。
@param path XPath文字列
@see REXML::Element#get_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.text # => "some text "
//}... -
URI
:: MailTo # to _ mailtext -> String (15238.0) -
URI オブジェクトからメールテキスト文字列を生成します。
...:
require '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>
To: ruby-list@ruby-lang.org
Subject: subscribe
Cc: myaddr... -
URI
:: MailTo # to _ rfc822text -> String (15238.0) -
URI オブジェクトからメールテキスト文字列を生成します。
...:
require '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>
To: ruby-list@ruby-lang.org
Subject: subscribe
Cc: myaddr... -
REXML
:: Element # text=(text) (12497.0) -
「先頭の」テキストノードを text で置き換えます。
... text で置き換えます。
テキストノードを1つ以上保持している場合はそのうち
最初のノードを置き換えます。
要素がテキストノードを保持していない場合は新たなテキストノードが追加されます。
text には文字列、REXML::T......ext、nil のいずれかが指定できます。
REXML::Text オブジェクトを指定した場合には、それが設定され、
文字列を指定した場合には
REXML::Text.new(text, whitespace(), nil, raw())
で生成される Text オブジェクトが設定されます。
nil を指定......す。
@param text 置き換え後のテキスト(文字列、REXML::Text, nil(削除))
//emlist[][ruby]{
require '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/... -
REXML
:: Element # get _ text(path = nil) -> REXML :: Text | nil (12357.0) -
先頭のテキスト子ノードを返します。
...L::Text#value も参照してください。
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 "
//}... -
REXML
:: Element # each _ element _ with _ text(text = nil , max = 0 , name = nil) {|element| . . . } -> () (12351.0) -
テキストを子ノードとして 持つすべての子要素を引数としてブロックを呼び出します。
...クを呼び出します。
text を指定すると、テキストの内容が text であるもののみを対象とします。
maxを指定すると、対象となる子要素の先頭 max 個のみが対象となります。
name を指定すると、それは xpath 文字列と見なされ、......)。
@param text テキストの中身(文字列)
@param max ブロック呼出の対象とする子要素の最大個数
@param name xpath文字列
//emlist[][ruby]{
require '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> ... </>
//}... -
REXML
:: Text # to _ s -> String (9143.0) -
テキストの内容を正規化(すべての実体をエスケープ)された状態で返します。
...トとして妥当です。
結果は REXML::Text.new で指定した entity_filter を反映しています。
@see REXML::Text#value
//emlist[][ruby]{
require 'rexml/document'
t = REXML::Text.new("< & foobar", false, nil, false)
t.to_s # => "< & foobar"
t.value # => "< & foobar"
//}... -
Enumerator
:: Yielder # to _ proc -> Proc (9119.0) -
Enumerator.new で使うメソッドです。
...Enumerator.new で使うメソッドです。
引数を Enumerator::Yielder#yield に渡す Proc を返します。
これは Enumerator::Yielder オブジェクトを他のメソッドにブロック引数と
して直接渡すために使えます。
//emlist[例][ruby]{
text = <<-END
Hello
こ......んにちは
END
enum = Enumerator.new do |y|
text.each_line(&y)
end
enum.each do |line|
p line
end
# => "Hello\n"
# "こんにちは\n"
//}... -
OpenURI
:: Meta # meta -> Hash (9113.0) -
ヘッダを収録したハッシュを返します。
...す。
//emlist[例][ruby]{
require 'open-uri'
open('http://example.com/') {|f|
p f.meta
#=> {"date"=>"Sun, 04 May 2008 11:26:40 GMT",
# "content-type"=>"text/html;charset=utf-8",
# "server"=>"Apache/2.0.54 (Debian GNU/Linux) mod_ssl/2.0.54 OpenSSL/0.9.7e",
# "transfer-encoding"=......す。
//emlist[例][ruby]{
require 'open-uri'
URI.open('http://example.com/') {|f|
p f.meta
#=> {"date"=>"Sun, 04 May 2008 11:26:40 GMT",
# "content-type"=>"text/html;charset=utf-8",
# "server"=>"Apache/2.0.54 (Debian GNU/Linux) mod_ssl/2.0.54 OpenSSL/0.9.7e",
# "transfer-encodi...