るりまサーチ

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

別のキーワード

  1. _builtin all?
  2. pop delete_all
  3. pop3 delete_all
  4. net/pop delete_all
  5. pop all

ライブラリ

クラス

検索結果

Hash#delete(key) -> object | nil (18139.0)

key に対応する要素を取り除きます。

...ッチする要素がなかった時に評価され、その結果を返します。

//emlist[例][ruby]{
h = {:ab => "some" , :cd => "all"}

p h.delete(:ab) #=> "some"
p h.delete(:ef) #=> nil
p h.delete(:ef){|key|"#{key} Nothing"} #=> "ef Nothing"

p h #=> {:cd=>"all"}
//}

@see Hash#delete_if...

Hash#delete(key) {|key| ... } -> object (18139.0)

key に対応する要素を取り除きます。

...ッチする要素がなかった時に評価され、その結果を返します。

//emlist[例][ruby]{
h = {:ab => "some" , :cd => "all"}

p h.delete(:ab) #=> "some"
p h.delete(:ef) #=> nil
p h.delete(:ef){|key|"#{key} Nothing"} #=> "ef Nothing"

p h #=> {:cd=>"all"}
//}

@see Hash#delete_if...

Net::POP3#delete_all -> () (12217.0)

サーバ上のメールを全て消去します。

...きは消去する前に各メールを引数としてブロックを呼びだします。
メールは Net::POPMail のインスタンスとして渡されます。

使用例:

require 'net/pop'

n = 1
pop.delete_all do |m|
File.open("inbox/#{n}") {|f| f.write m.pop }
n += 1
end...

Net::POP3#delete_all {|popmail| .... } -> () (12217.0)

サーバ上のメールを全て消去します。

...きは消去する前に各メールを引数としてブロックを呼びだします。
メールは Net::POPMail のインスタンスとして渡されます。

使用例:

require 'net/pop'

n = 1
pop.delete_all do |m|
File.open("inbox/#{n}") {|f| f.write m.pop }
n += 1
end...

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

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

...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='1' bar:att='2'/>
//}...

絞り込み条件を変える

REXML::Elements#delete_all(xpath) -> [REXML::Element] (12215.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/>"
//}...