592件ヒット
[1-100件を表示]
(0.142秒)
種類
- インスタンスメソッド (492)
- 特異メソッド (64)
- ライブラリ (24)
- 文書 (12)
ライブラリ
- matrix (160)
-
rexml
/ document (396)
クラス
- Matrix (40)
-
REXML
:: Attributes (144) -
REXML
:: Element (132) -
REXML
:: Elements (108) -
REXML
:: XPath (12) - Vector (120)
キーワード
- * (24)
- << (12)
- [] (24)
- []= (24)
- add (12)
-
add
_ element (12) - attribute (12)
- build (24)
- collect (24)
- combine (16)
- delete (24)
-
delete
_ all (24) -
delete
_ element (12) - each (24)
-
each
_ attribute (12) -
elements
_ to _ f (12) -
elements
_ to _ i (12) -
elements
_ to _ r (12) - first (12)
-
get
_ attribute (12) -
get
_ attribute _ ns (12) -
has
_ elements? (12) - length (12)
- map (24)
- namespace (12)
- namespaces (24)
-
next
_ element (12) - prefixes (24)
-
rdoc
/ parser / c (12) -
rexml
/ document (12) - root (12)
-
root
_ node (12) -
ruby 1
. 8 . 4 feature (12) - size (24)
-
to
_ a (12) - xpath (12)
検索結果
先頭5件
-
Vector
. elements(a , copy = true) -> Vector (24219.0) -
配列 a を要素とするベクトルを生成します。 ただし、オプション引数 copy が偽 (false) ならば、複製を行いません。
...Vectorを生成する際の要素の配列
@param copy 引数の配列 a のコピーをするかどうかのフラグ
//emlist[例][ruby]{
require 'matrix'
a = [1, 2, 3, 4]
v1 = Vector.elements(a, true)
v2 = Vector.elements(a, false)
p v1 # => Vector[1, 2, 3, 4]
p v2 # => Vector[1......, 2, 3, 4]
a[0] = -1
p v1 # => Vector[1, 2, 3, 4]
p v2 # => Vector[-1, 2, 3, 4]
//}... -
Vector
# elements _ to _ f -> Vector (15219.0) -
ベクトルの各成分をFloatに変換したベクトルを返します。
...ベクトルの各成分をFloatに変換したベクトルを返します。
このメソッドは deprecated です。 map(&:to_f) を使ってください。
//emlist[例][ruby]{
require 'matrix'
v = Vector.elements([2, 3, 5, 7, 9])
p v.elements_to_f
# => Vector[2.0, 3.0, 5.0, 7.0, 9.0]
//}... -
Vector
# elements _ to _ i -> Vector (15219.0) -
ベクトルの各成分をIntegerに変換したベクトルを返します。
...ベクトルの各成分をIntegerに変換したベクトルを返します。
このメソッドは deprecated です。 map(&:to_i) を使ってください。
//emlist[例][ruby]{
require 'matrix'
v = Vector.elements([2.5, 3.0, 5.01, 7])
p v.elements_to_i
# => Vector[2, 3, 5, 7]
//}... -
Vector
# elements _ to _ r -> Vector (15219.0) -
ベクトルの各成分をRationalに変換したベクトルを返します。
...クトルの各成分をRationalに変換したベクトルを返します。
このメソッドは deprecated です。 map(&:to_r) を使ってください。
//emlist[例][ruby]{
require 'matrix'
v = Vector.elements([2.5, 3.0, 5.75, 7])
p v.elements_to_r
# => Vector[(5/2), (3/1), (23/4), (7/1)... -
REXML
:: Element # has _ elements? -> bool (12237.0) -
self が一つでも子要素を持つならば true を返します。
... true を返します。
//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new("<a><b/><c>Text</c></a>")
doc.root.has_elements? # => true
doc.elements["/a/b"].has_elements? # => false
# /a/c はテキストノードしか持たないので false である
doc.elements......["/a/c"].has_elements? # => false
//}... -
REXML
:: Attributes # each _ attribute {|attribute| . . . } -> () (9212.0) -
各属性に対しブロックを呼び出します。
...ML::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='<'/>
</root>
EOS
a = doc.get_elements("/root/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", "<"]
//}... -
REXML
:: Elements # delete(element) -> Element (9136.0) -
element で指定した子要素を取り除きます。
...element で指定した子要素を取り除きます。
element には、REXML::Element、整数、文字列が指定できます。
Element オブジェクトを指定した場合は、その子要素を取り除きます。
整数を指定した場合には element 番目の子要素を削除し......ath で指定した場合、子要素ではない要素も取り除けることに注意してください。
@param element 削除する要素(REXML::Element, 整数, 文字列)
//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new '<a><b/><c/><c id="1"/></a>'
b = doc.root.elements......[1]
doc.root.elements.delete b # => <b/>
doc.root.to_s # => "<a><c/><c id='1'/></a>"
doc.elements.delete("a/c[@id='1']") # => <c id='1'/>
doc.root.to_s # => "<a><c/></a>"
doc.root.elements.delete 1 # => <c/>
doc.root.to_s... -
REXML
:: Elements # to _ a(xpath = nil) -> [REXML :: Element] (9124.0) -
すべての子要素の配列を返します。
...す。
xpath を指定した場合は、その XPath 文字列に
マッチする要素の配列を返します。
REXML::Elements#each と同様、REXML::XPath.match などと
異なり、要素以外の子ノードは無視されます。
@param xpath XPath文字列
//emlist[][ruby]{
require '......rexml/document'
require 'rexml/xpath'
doc = REXML::Document.new '<a>sean<b/>elliott<c/></a>'
doc.root.elements.to_a # => [<b/>, <c/>]
doc.root.elements.to_a("child::node()") # => [<b/>, <c/>]
REXML::XPath.match(doc.root, "child::node()") # => ["sean", <b/>, "elliott", <c/>]
//}... -
REXML
:: Attributes # get _ attribute(name) -> Attribute | nil (9112.0) -
name という名前の属性を取得します。
...ttributes#[]
//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='<'/>
</root>
EOS
a = doc.get_elements("/root/a").first
a.attributes.get_attribute("att......") # => att='<'
a.attributes.get_attribute("foo:att") # => foo:att='1'
//}...