るりまサーチ

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

別のキーワード

  1. _builtin delete
  2. _builtin delete_if
  3. cgi delete
  4. pop delete_all
  5. pop3 delete_all

ライブラリ

クラス

検索結果

REXML::Attributes#delete_all(name) -> [REXML::Attribute] (18113.0)

name という名前を持つ属性をすべて削除します。

...uire '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_all("att") # => [att='&lt;']
a # => <a foo:att=...

REXML::Elements#delete_all(xpath) -> [REXML::Element] (18113.0)

xpath で指定した XPath 文字列にマッチする要素をすべて取り除きます。

...べて取り除きます。

@param xpath 取り除く要素を指し示す XPath 文字列

//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new('<a><c/><c/><c/><c/></a>')
doc.elements.delete_all("a/c") # => [<c/>, <c/>, <c/>, <c/>]
doc.to_s # => "<a/>"
//}...

net/pop (60.0)

このライブラリは、POP3 (Post Office Protocol version 3) を 用いてPOPサーバからメールを受信する機能を提供するライブラリです。

...'YourPassword' は適当なアカウント名とパスワード
に適宜読みかえてください。

require 'net/pop'

pop = Net::POP3.new('pop.example.com', 110)
pop.start('YourAccount', 'YourPassword') # POPのセッションを開始
if pop.mails.empty?
$stderr.puts 'no mail.'...
...省略や短縮用メソッドを避けたためにかなり冗長です。
まず、ブロック付きの Net::POP3.start を使うことで
POP3.new, #start, #finish を併合できます。

require 'net/pop'

Net::POP3.start('pop.example.com', 110,
'YourAccount', 'YourPas...
...') {|f|
f.write m.pop
}
m.delete
end
$stderr.puts "#{pop.mails.size} mails popped."
end
}

Net::POP3#delete_all を使うと
さらに Net::POP3#each_mail と
Net::POPMail#delete を併合できます。

require 'net/pop'

Net::POP3.start('pop.examp...