るりまサーチ

最速Rubyリファレンスマニュアル検索!
594件ヒット [501-594件を表示] (0.200秒)
トップページ > クエリ:-[x] > クエリ:r[x] > クエリ:at[x] > クエリ:l[x] > クエリ:element[x]

別のキーワード

  1. _builtin to_r
  2. open3 pipeline_r
  3. matrix elements_to_r
  4. fileutils rm_r
  5. fileutils cp_r

検索結果

<< < ... 4 5 6 >>

REXML::Element#text(path = nil) -> String | nil (9406.0)

先頭のテキスト子ノードの文字列を返します。

...クセスできないことに注意してください。

r
aw モードの設定は無視され、常に正規化されたテキストを返します。
R
EXML::Text#value も参照してください。

path を渡した場合は、その XPath 文字列で指定される
テキストノードの...
...には nil を返します。

@param path XPath文字列
@see REXML::Element#get_text

//emlist[][ruby]{
r
equire 'rexml/document'
doc = REXML::Document.new "<p>some text <b>this is bold!</b> more text</p>"
# doc.root (<p> ... </p>) は2つのテキストノード("some text " と " more text"
# を...
...持っているが、前者を返す
doc.root.text # => "some text "
//}...

Vector#collect! -> Enumerator (9402.0)

ベクトルの各要素を順番にブロックに渡して評価し、その結果で要素を置き換えます。

...素を置き換えます。

ブロックのない場合は、自身と map! から生成した Enumerator オブジェクトを返します。

//emlist[例][ruby]{
r
equire 'matrix'

v = Vector[1, 2, 3]
p v.map!{ |el| el * 2 } #=> Vector[2, 4, 6]
p v #=> Vector[2, 4, 6]
//}...

Array#take_while -> Enumerator (9401.0)

配列の要素を順に偽になるまでブロックで評価します。 最初に偽になった要素の手前の要素までを配列として返します。 このメソッドは自身を破壊的に変更しません。

...の要素までを配列として返します。
このメソッドは自身を破壊的に変更しません。

//emlist[例][ruby]{
a = [1, 2, 3, 4, 5, 0]
a.take_while {|i| i < 3 } # => [1, 2]
//}

ブロックを省略した場合は Enumerator を返します。

@see Enumerable#take_while...

REXML::Elements#inject(xpath = nil, initial = nil) {|element| ... } -> object (9401.0)

Enumerable#inject と同様、 各子要素に対し畳み込みをします。

...Enumerable#inject と同様、
各子要素に対し畳み込みをします。

xpath を指定した場合は、その XPath 文字列に
マッチする要素に対し同様の操作をします。

@param xpath XPath文字列
@see REXML::Elements#each...

Module#ruby2_keywords(method_name, ...) -> nil (9338.0)

For the given method names, marks the method as passing keywords through a normal argument splat. This should only be called on methods that accept an argument splat (`*args`) but not explicit keywords or a keyword splat. It marks the method such that if the method is called with keyword arguments, the final hash argument is marked with a special flag such that if it is the final element of a normal argument splat to another method call, and that method call does not include explicit keywords or a keyword splat, the final element is interpreted as keywords. In other words, keywords will be passed through the method to other methods.

...For the given method names, marks the method as passing keywords through
a normal argument splat. This should only be called on methods that
accept an argument splat (`*args`) but not explicit keywords or a
keyword splat. It marks the method such that if the method is called
with keyword argument...
...al hash argument is marked with a special
flag such that if it is the final element of a normal argument splat to
another method call, and that method call does not include explicit
keywords or a keyword splat, the final element is interpreted as
keywords. In other words, keywords will be passed thr...
...other methods.

This should only be used for methods that delegate keywords to another
method, and only for backwards compatibility with Ruby versions before
2.7.

This method will probably be removed at some point, as it exists only
for backwards compatibility. As it does not exist in Ruby version...

絞り込み条件を変える

REXML::Attribute#namespace(arg = nil) -> String | nil (9324.0)

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

...URI を返します。

URI が定義されていない場合は nil を返します。

@param arg この値を指定すると、その属性の名前空間でなく、arg という名前空間
の URI が返されます。
通常は省略します。

//emlist[][ruby]{
r
equire 'rexml...
.../document'
e = REXML::Element.new("el")
e.add_attribute("xmlns:ns", "http://www.example.com/ns")
e.add_attribute("ns:r", "rval")
p e.attributes.get_attribute("r").prefix # => "ns"
p e.attributes.get_attribute("r").namespace # => "http://www.example.com/ns"
//}...

Matrix#map!(which = :all) {|element| ... } -> self (9314.0)

行列の各要素に対してブロックの適用を繰り返した結果で要素を置き換えます。

...Enumerator オブジェクトを返します。

@param which which に以下の Symbol を指定することで、
引数として使われる要素を限定できます。
デフォルトは、:all (全ての要素)です。
指定できる Symbol の詳...
...細は、 Matrix#each の項目を参照して下さい。


//emlist[例][ruby]{
r
equire 'matrix'

m = Matrix[[1, 2], [3, 4]]

p m.map! { |element| element * 10 } #=> Matrix[[10, 20], [30, 40]]
p m #=> Matrix[[10, 20], [30, 40]]
//}

@see Matrix#each, Matrix#map...

Enumerable#reverse_each -> Enumerator (9301.0)

逆順に各要素に対してブロックを評価します。

...持した配列を作ります。

ブロックを省略した場合は、各要素を逆順に辿る
Enumerator を返します。

//emlist[例][ruby]{
{a: 1, b: 2, c: 3}.reverse_each # => #<Enumerator: ...>
{a: 1, b: 2, c: 3}.reverse_each { |v| p v }
# => [:c, 3]
# [:b, 2]
# [:a, 1]
//}...

Matrix.combine(*matrices) {|*elements| ... } -> Matrix (6706.0)

要素ごとにブロックを呼び出した結果を組み合わせた Matrix を返します。

...クを呼び出した結果を組み合わせた Matrix を返します。

//emlist[例][ruby]{
r
equire 'matrix'
x = Matrix[[6, 6], [4, 4]]
y = Matrix[[1, 2], [3, 4]]
Matrix.combine(x, y) {|a, b| a - b} # => Matrix[[5, 4], [1, 0]]
//}

@param matrices 並べる行列。すべての行列の行数...
...と列数が一致していなければならない
@raise ExceptionForMatrix::ErrDimensionMismatch 行や列の要素数が一致しない時に発生します
@see Matrix#combine...

Matrix#combine(*matrices) {|*elements| ... } -> Matrix (6700.0)

要素ごとにブロックを呼び出した結果を組み合わせた Matrix を返します。

...要素ごとにブロックを呼び出した結果を組み合わせた Matrix を返します。

Matrix.combine(self, *matrices) { ... } と同じです。

@see Matrix.combine...

絞り込み条件を変える

Vector#map! -> Enumerator (6302.0)

ベクトルの各要素を順番にブロックに渡して評価し、その結果で要素を置き換えます。

...素を置き換えます。

ブロックのない場合は、自身と map! から生成した Enumerator オブジェクトを返します。

//emlist[例][ruby]{
r
equire 'matrix'

v = Vector[1, 2, 3]
p v.map!{ |el| el * 2 } #=> Vector[2, 4, 6]
p v #=> Vector[2, 4, 6]
//}...

正規表現 (3858.0)

正規表現 * metachar * expansion * char * anychar * string * str * quantifier * capture * grouping * subexp * selector * anchor * cond * option * encoding * comment * free_format_mode * absenceop * list * specialvar * references

...* metachar
* expansion
* char
* anychar
* string
* str
* quantifier
* capture
* grouping
* subexp
* selector
* anchor
* cond
* option
* encoding
* comment
* free_format_mode
* absenceop
* list
* specialvar
* references


正規表現(regular expression)は...
...//emlist[][ruby]{
/[a-z]/
/\Axyz\Z/
//}

という正規表現において "[a-z]", "\A", "\Z"はメタ文字列です。

===[a:expansion] 式展開
正規表現内では、#{式} という形式で式を評価した文字列を埋め込むことが
できます。

//emlist[][ruby]{
place = "東...
...emlist[][ruby]{
/\A(?<a>|.|(?:(?<b>.)\g<a>\k<b+0>))\z/.match("rekxker")
# => #<MatchData "rekxker" a:"rekxker" b:"k">
//}

以下の例では、開始タグと終了タグを対応付ける正規表現です。

//emlist[][ruby]{
r
= Regexp.compile(<<'__REGEXP__'.strip, Regexp::EXTENDED)
(?<element>...
<< < ... 4 5 6 >>