るりまサーチ (Ruby 2.3.0)

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

別のキーワード

  1. psych psych_y
  2. psych y
  3. kernel y
  4. kernel psych_y
  5. y kernel

ライブラリ

クラス

キーワード

検索結果

REXML::Element#add_attribute(key, value) -> () (63964.0)

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

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

引数の与えかたは2通りあります。
要素名と値の2つの文字列で渡す方法と REXML::Attribute オブジェクトを
渡す方法です。

文字列2つで指定する場合、属性値は unnormalized な文字列を渡す必要があります。

@param key 属性名(文字列)
@param value 属性値(文字列)
@param attr 属性(REXML::Attribute オブジェクト)

//emlist[][ruby]{
require 'rexml/document'
doc = ...

REXML::Element#delete_attribute(key) -> REXML::Attribute | nil (18694.0)

要素から key という属性名の属性を削除します。

要素から key という属性名の属性を削除します。

削除された属性を返します。

key という属性名の属性が存在しない場合は削除されずに、nil を返します。

@param key 削除する要素(文字列(属性名) or REXML::Attributeオブジェクト)

//emlist[][ruby]{
require 'rexml/document'
e = REXML::Element.new("E")
e.add_attribute("x", "foo"); e # => <E x='foo'/>
e.add_attribute("y:x", "bar"); e # => <E x...

REXML::Attribute#prefix -> String (9058.0)

属性の名前空間を返します。

属性の名前空間を返します。

//emlist[][ruby]{
require 'rexml/document'
e = REXML::Element.new( "elns:myelement" )
e.add_attribute( "nsa:a", "aval" )
e.add_attribute( "b", "bval" )
p e.attributes.get_attribute( "a" ).prefix # -> "nsa"
p e.attributes.get_attribute( "b" ).prefix # -> "elns"
a = REXML::Attribute...