るりまサーチ

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

別のキーワード

  1. installer spec
  2. format spec=
  3. format spec
  4. oldformat spec
  5. uninstaller spec

検索結果

演算子式 (23000.0)

演算子式 * assign * selfassign * multiassign * range * range_cond * and * or * not * cond

演算子式
* assign
* selfassign
* multiassign
* range
* range_cond
* and
* or
* not
* cond

//emlist[例][ruby]{
1+2*3/4
//}

プログラミングの利便のために一部のメソッド呼び出しと制御構造は演算子形
式をとります。Rubyには以下にあげる演算子があります。

高い ::
[]
+(単項) ! ~
**
...

Rubyで使われる記号の意味(正規表現の複雑な記号は除く) (60.0)

Rubyで使われる記号の意味(正規表現の複雑な記号は除く) ex q num per and or  plus minus ast slash hat sq  period comma langl rangl eq tilde  dollar at under lbrarbra  lbra2rbra2 lbra3rbra3 dq colon ac  backslash semicolon

...a2 lbra3rbra3 dq colon ac 
backslash semicolon

===[a:ex] !

: !true

not 演算子。d:spec/operator#notを参照。

: 3 != 5

「等しくない」比較演算子。d:spec/operator#notを参照。

: def xxx!

「!」はメソッド名の一部です。慣用的に、
同名の(!...
...ド名の一部分です。
慣用的に、真偽値を返すタイプのメソッドを示すために使われます。

: xx ? yy : zz

d:spec/operator#cond。三項演算子とも呼ばれます。if xx then yy else zz end と同じ意味です。

: /xxx?/

正規表現の、量指定子(qua...
...・ *がついた引数

メソッド呼出の引数展開。spec/call と d:spec/def#method を参照。

: x, *y = foo()

多重代入。d:spec/operator#multiassign を参照。

: /xx*/

正規表現の、直前の表現の 0 回以上の繰り返し。できるだけ長くマッチしよう...

Ruby用語集 (24.0)

Ruby用語集 A B C D E F G I J M N O R S Y

...h)」に
おける & も演算子である。
defined? のように、見た目がメソッドのような演算子もある。

参照:spec/operator

: 汚染
: taint
Ruby のオブジェクトは「汚染されているか否か」という状態を持ち、
Ruby のセキュリティ...
...が確定するので、ex2 は評価しない。

Ruby の &&、and、||、or の評価は短絡評価である。

参照:d:spec/operator#and、d:spec/operator#or

: 抽象クラス
: abstract class
Ruby には言語仕様として抽象クラスはないが、
直接のインスタン...
...っている。これは
演算子に結合の優先順位があり、+ よりも * のほうが順位が上だからである。

参照:spec/operator

: 有理数
: rational number
数学的には「整数分の整数」の形の分数(分母は非零)で表せる数のことだが、...

クラス/メソッドの定義 (12.0)

クラス/メソッドの定義 * クラス/メソッドの定義: * class * singleton_class * module * method * operator * nest_method * eval_method * singleton_method * class_method * limit * 定義に関する操作: * alias * undef * defined

...f foo a, bとも
a + 3 * b
end
//}

メソッド名としては通常の識別子の他に、再定義可能な演算子(例: ==, +, -
など spec/operator を参照)も指定できます(operator参照)。

//emlist[例][ruby]{
class Vector2D
attr_accessor :x, :y # インスタンス変数@x,...
...ェクトを返します。

@see https://magazine.rubyist.net/articles/0041/0041-200Special-kwarg.html

====[a:operator] 演算子式の定義

spec/operator
において、「再定義可能な演算子」に分類された演算子の実装
はメソッドなので、定義することが可能で...

リテラル (12.0)

リテラル * num * string * backslash * exp * char * command * here * regexp * array * hash * range * symbol * percent

...ュ式は評価されるたびに毎回新しいハッシュオブジェクトを生成します。

===[a:range] 範囲オブジェクト

d:spec/operator#rangeを参照

範囲式はその両端が数値リテラルであれば、何度評価されても同じオブジェク
トを返します。...
...対一に対応します。

Symbol リテラルに指定できる演算子はメソッドとして再定義できる演算子だ
けです。spec/operator を参照して下さい。

以下の記法も使えます。

//emlist[][ruby]{
p :'foo-bar' #=> :"foo-bar"
p :"foo-bar" #=> :"foo-bar"
p %s{f...

絞り込み条件を変える

Range (6.0)

範囲オブジェクトのクラス。 範囲オブジェクトは文字どおり何らかの意味での範囲を表します。数の範囲はもちろん、 日付の範囲や、「"a" から "z" まで」といった文字列の範囲を表すこともできます。

...す。

==== 作り方

範囲オブジェクトは、Range.new を用いるほか、範囲演算子(`..' または `...')を
用いた d:spec/operator#range で生成できます。
いずれの方法でも始端と終端を与えます。

//emlist[範囲オブジェクトの例][ruby]{
Range....

オブジェクト指向スクリプト言語 Ruby リファレンスマニュアル (6.0)

オブジェクト指向スクリプト言語 Ruby リファレンスマニュアル * Ruby オフィシャルサイト https://www.ruby-lang.org/ja/ * 原著:まつもとゆきひろ * 最新版URL: https://www.ruby-lang.org/ja/documentation/

...* spec/terminate
* spec/thread
* spec/safelevel

Ruby の文法:
* spec/lexical
* spec/program
* spec/variables
* spec/literal
* spec/operator
* spec/control
* spec/call
* spec/def

その他:
* spec/m17n
* spec/regexp
* spec/lambda_proc

==== 組み込みライブラリ...
...:
* spec/eval
* spec/terminate
* spec/thread

Ruby の文法:
* spec/lexical
* spec/program
* spec/variables
* spec/literal
* spec/operator
* spec/control
* spec/call
* spec/def

その他:
* spec/m17n
* spec/regexp
* spec/lambda_proc

==== 組み込みライブラリ
*...

プログラム・文・式 (6.0)

プログラム・文・式 * exp * terminate

...(1+2)*3
foo()
if test then ok else ng end

Ruby の式には、spec/variables、さまざまなspec/literal、それらの
spec/operator
、if や while などのspec/control、spec/call、
spec/defがあります。

式は括弧によってグルーピングすることがで...

メソッド呼び出し(super・ブロック付き・yield) (6.0)

メソッド呼び出し(super・ブロック付き・yield) * super * block * yield * block_arg * numbered_parameters * call_method

...
idx += 1
end
end

sum = 0
iich([1, 4, 9, 16, 25]) {|elem|
sum += elem
}
p sum # => 55
//}

ブロックパラメータの代入はd:spec/operator#multiassignと同じルールで行われます。
また yield を実行したメソッドにブロックが渡されていない
(ブロッ...