るりまサーチ

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

別のキーワード

  1. _builtin |
  2. set |
  3. ipaddr |
  4. array |
  5. integer |

クラス

オブジェクト

キーワード

検索結果

<< 1 2 3 ... > >>

Matrix#tr -> Integer | Float | Rational | Complex (21507.0)

トレース (trace) を返します。

...トレース (trace) を返します。

行列のトレース (trace) とは、対角要素の和です。

//emlist[例][ruby]{
require 'matrix'
Matrix[[7,6], [3,9]].trace # => 16
//}

tr
ace は正方行列でのみ定義されます。

@raise ExceptionForMatrix::ErrDimensionMismatch 行列が...

TrueClass#|(other) -> bool (21242.0)

常に true を返します。

... true を返します。

@param other 論理和を行なう式です。

|
は再定義可能な演算子に分類されていますので、通常は true | other のように使われます。

//emlist[例][ruby]{
p true | true #=> true
p true | false #=> true
p true | nil #=> true
p...
... true | (1 == 1) #=> true
p true | (1 + 1) #=> true

p true.|(true) #=> true
p true.|(false) #=> true
p true.|(nil) #=> true
p true.|(1 == 1) #=> true
p true.|(1 + 1) #=> true
//}...

Vector#-(v) -> Vector | Matrix (18301.0)

self からベクトル v を減じたベクトルを返します。

...には column_size が 1 の Matrix オブジェクトも指定できます。
その場合は返り値も Matrix オブジェクトになります。

@param v 減算するベクトル。減算可能な行列やベクトルを指定します。

@raise ExceptionForMatrix::ErrDimensionMismatch 自...

Matrix#trace -> Integer | Float | Rational | Complex (9507.0)

トレース (trace) を返します。

...トレース (trace) を返します。

行列のトレース (trace) とは、対角要素の和です。

//emlist[例][ruby]{
require 'matrix'
Matrix[[7,6], [3,9]].trace # => 16
//}

tr
ace は正方行列でのみ定義されます。

@raise ExceptionForMatrix::ErrDimensionMismatch 行列が...

REXML::Attributes#each_attribute {|attribute| ... } -> () (9413.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 fo...
...o:att='1' bar:att='2' att='&lt;'/>
</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", "<"]
//}...

絞り込み条件を変える

TracePoint.trace(*events) {|obj| ... } -> TracePoint (9413.0)

新しい TracePoint オブジェクトを作成して自動的にトレースを開始し ます。TracePoint.new のコンビニエンスメソッドです。

...新しい TracePoint オブジェクトを作成して自動的にトレースを開始し
ます。TracePoint.new のコンビニエンスメソッドです。

@param events トレースするイベントを String か Symbol で任
意の数指定します。指定できる値に...
...ついては
Tr
acePoint.new を参照してください。

//emlist[例][ruby]{
tr
ace = TracePoint.trace(:call) { |tp| [tp.lineno, tp.event] }
# => #<TracePoint:0x007f786a452448>

tr
ace.enabled? # => true
//}

@raise ThreadError ブロックを指定しなかった場合に発生し...

String#tr_s!(pattern, replace) -> self | nil (9404.0)

文字列の中に pattern 文字列に含まれる文字が存在したら、 replace 文字列の対応する文字に置き換えます。さらに、 置換した部分内に同一の文字の並びがあったらそれを 1 文字に圧縮します。

... tr(1) と同じです。
つまり「a-c」は a から c を意味し、
"^0-9" のように文字列の先頭が「^」の場合は指定した文字以外が置換の対象になります。

replace でも「-」を使って範囲を指定できます。

//emlist[][ruby]{
p "gooooogle".tr_s...
...("a-z", "A-Z") # => "GOGLE"
//}

-」は文字列の両端にない場合にだけ範囲指定の意味になります。
同様に、「^」もその効果は文字列の先頭にあるときだけです。
また、「-」、「^」、「\」はバックスラッシュ (「\」) でエスケ...
...われます。

tr
_s は置換後の文字列を生成して返します。
tr
_s! は self を変更して返しますが、
置換が起こらなかった場合は nil を返します。

注意:
一般に、tr_s! を tr! と squeeze! で置き換えることはできません。
tr
! と squeeze!...

Psych::Visitors::YAMLTree#tree -> Psych::Nodes::Stream|nil (9401.0)

変換を終了し、構築した AST を返します。

...変換を終了し、構築した AST を返します。

内部で finish を呼び出し、変換処理を終了します。

このメソッドを2回以上呼ぶと、2回目以降は nil を返します。

@see Psych::Visitors::YAMLTree#finish...

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

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

...ML::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;'/>
</root>
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#get_attribute_ns(namespace, name) -> REXML::Attribute | nil (9401.0)

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

...XML::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.get_attribute_ns("http://exa...
...mple.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
//}...

絞り込み条件を変える

<< 1 2 3 ... > >>