るりまサーチ

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

別のキーワード

  1. matrix l
  2. _builtin $-l
  3. kernel $-l
  4. lupdecomposition l
  5. l matrix

ライブラリ

検索結果

<< 1 2 3 ... > >>

REXML::Element#attribute(name, namespace = nil) -> REXML::Attribute | nil (21332.0)

name で指定される属性を返します。

...name で指定される属性を返します。

属性は REXML::Attribute オブジェクトの形で返します。

name は "foo:bar" のように prefix を指定することができます。

namespace で名前空間の URI を指定することで、その名前空間内で
name という...
...il を返します。

@param name 属性名(文字列)
@param namespace 名前空間のURI(文字列)
//emlist[][ruby]{
require '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='&l...
...t;'/>
</root>
EOS
a = doc.get_elements("/root/a").first
a.attribute("att") # => att='&lt;'
a.attribute("att", "http://example.org/bar") # => bar:att='2'
a.attribute("bar:att") # => bar:att='2'
a.attribute("baz") # => nil
//}...

REXML::Attributes#get_attribute_ns(namespace, name) -> REXML::Attribute | nil (12326.0)

namespace と name で特定される属性を返します。

...場合は nil を返します。

XML プロセッサが prefix を置き換えてしまった場合でも、このメソッドを
使うことで属性を正しく指定することができます。

@param namespace 名前空間(URI, 文字列)
@param name 属性名(文字列)

//emlist[][ruby]{...
...'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.get_attribute_ns("", "att") # => att='&lt;'
a.attributes.ge...
...t_attribute_ns("http://example.org/foo", "att") # => foo:att='1'
a.attributes.get_attribute_ns("http://example.org/baz", "att") # => nil
a.attributes.get_attribute_ns("http://example.org/foo", "attt") # => nil
//}...

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

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

...il を返します。

@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='foo' y:x='bar'/>
e.del...
...ete_attribute("x"); e # => <E y:x='bar'/>
//}...

REXML::Element#each_element_with_attribute(key, value = nil, max = 0, name = nil) {|element| ... } -> () (12325.0)

特定の属性を持つすべての子要素を引数としてブロックを呼び出します。

...を呼び出します。

key で指定した属性名の属性を持つ要素のみを対象とします。
value を指定すると、keyで指定した属性名を持つ属性の値がvalueである
もののみを対象とします。
maxを指定すると、対象となる子要素の先頭 max...
...)
@param value 属性値(文字列)
@param max ブロック呼出の対象とする子要素の最大個数
@param name xpath文字列

//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new("<a><b id='1'/><c id='2'/><d id='1'/><e/></a>")
doc.root.each_element_with_attribute('id'){|e|...
...d='1'/>
# >> <c id='2'/>
# >> <d id='1'/>
doc.root.each_element_with_attribute('id', '1'){|e| p e }
# >> <b id='1'/>
# >> <d id='1'/>
doc.root.each_element_with_attribute('id', '1', 1){|e| p e }
# >> <b id='1'/>
doc.root.each_element_with_attribute('id', '1', 0, 'd'){|e| p e }
# >> <d id='1'/>
//}...

REXML::Attributes#get_attribute(name) -> Attribute | nil (12314.0)

name という名前の属性を取得します。

...合は nil を返します。

@param name 属性名(文字列)
@see REXML::Attributes#[]

//emlist[][ruby]{
require '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;'/>
</roo...
...t>
EOS
a = doc.get_elements("/root/a").first

a.attributes.get_attribute("att") # => att='&lt;'
a.attributes.get_attribute("foo:att") # => foo:att='1'
//}...

絞り込み条件を変える

REXML::Attributes#each_attribute {|attribute| ... } -> () (12214.0)

各属性に対しブロックを呼び出します。

...は REXML::Attribute オブジェクトで渡されます。

//emlist[][ruby]{
require '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("/r...
...oot/a").first

a.attributes.each_attribute do |attr|
p [attr.namespace, attr.name, attr.value]
end
# => ["http://example.org/foo", "att", "1"]
# => ["http://example.org/bar", "att", "2"]
# => ["", "att", "<"]
//}...

Gem::Specification.attribute_alias_singular(singular, plural) -> () (12207.0)

既に存在する複数形の属性の単数形バージョンを定義します。

...うに定義すると
attribute
_alias_singular :require_path, :require_paths
# こう書くかわりに
s.require_paths = ['mylib']
# こう書くことができます。
s.require_path = 'mylib'

@param singular 属性名の単数形を指定します。

@param plural 属性名の複数...

Gem::Specification.attribute_defaults -> Array (12201.0)

@todo

...@todo

@@attributes の複製を返します。...

OpenSSL::X509::Request#attributes -> [OpenSSL::X509::Attribute] (9357.0)

CSR が保持している attribute を OpenSSL::X509::Attribute の配列で返します。

... attribute を OpenSSL::X509::Attribute
の配列で返します。

attribute
とは X.509 証明書署名要求 に含まれる申請者に関する
追加的な情報です。必須ではありません。X.509v3 拡張領域を
CSR に含めるときは "reqExt" という oid の attribute...
...を追加
します。

@see OpenSSL::X509::Request#attribute=,
OpenSSL::X509::Request#add_attribute...

REXML::DocType#attribute_of(element, attribute) -> String | nil (9354.0)

DTD 内の属性リスト宣言で、 element という名前の要素の attribute という 名前の属性のデフォルト値を返します。

...内の属性リスト宣言で、 element という名前の要素の attribute という
名前の属性のデフォルト値を返します。

elementという名前の要素の属性値は宣言されていない、
elementという名前の要素にはattributeという名前の属性が宣言...
...かの場合は nil を返します。

@param element 要素名(文字列)
@param attribute 属性名(文字列)

//emlist[][ruby]{
require 'rexml/document'

doctype = REXML::Document.new(<<EOS).doctype
<!DOCTYPE books [
<!ELEMENT book (comment)>
<!ELEMENT comment (#PCDATA)>
<!ATTLIST book...
...title CDATA #REQUIRED
publisher CDATA "foobar publisher">
]>
EOS

p doctype.attribute_of("book", "publisher") # => "foobar publisher"
p doctype.attribute_of("bar", "foo") # => nil
p doctype.attribute_of("book", "baz") # => nil
p doctype.attribute_of("book", "title") # => nil
//}...

絞り込み条件を変える

<< 1 2 3 ... > >>