るりまサーチ

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

別のキーワード

  1. rexml/document attributes
  2. attributes get_attribute
  3. attributes each_attribute
  4. attributes get_attribute_ns
  5. element add_attributes

ライブラリ

クラス

検索結果

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

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

...属性の属性名と属性値の対の集合(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='b' c='d'/>
//}...