るりまサーチ

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

別のキーワード

  1. array fill
  2. array []
  3. array sample
  4. array index

ライブラリ

検索結果

REXML::Element#add_attributes(attrs) -> () (25.0)

要素の属性を複数追加します。 同じ名前の属性がすでにある場合はその属性を新しい 属性で置き換えます。

...ます。
同じ名前の属性がすでにある場合はその属性を新しい
属性で置き換えます。

attrs には Hash もしくは Array を指定できます。
Hash の場合は、
{ "name1" => "value1", "name2" => "value2", ... }
という形で、配列の場合は
[ ["name1",...
...trs 追加する属性の属性名と属性値の対の集合(Array or Hash)

//emlist[][ruby]{
require 'rexml/document'
e = REXML::Element.new("e")
e.add_attributes({"a" => "b", "c" => "d"})
e # => <e a='b' c='d'/>
e = REXML::Element.new("e")
e.add_attributes([["a", "b"], ["c", "d"]])
e # => <e a='...