種類
- インスタンスメソッド (1160)
- モジュール関数 (142)
- 特異メソッド (88)
- 定数 (11)
ライブラリ
- ビルトイン (676)
-
cgi
/ html (517) - cmath (120)
-
json
/ add / complex (22) - matrix (22)
-
ripper
/ lexer (44)
クラス
- Bignum (3)
- Complex (549)
- Fixnum (3)
- Matrix (22)
- NilClass (11)
- Numeric (44)
- Ripper (11)
-
Ripper
:: Lexer (33) - SignalException (55)
- String (11)
モジュール
-
CGI
:: HtmlExtension (517) - CMath (120)
- Kernel (22)
キーワード
- * (11)
- ** (11)
- + (11)
- - (11)
- -@ (11)
-
/ (11) - < (11)
- <= (11)
- <=> (5)
- == (11)
- >= (11)
- Complex (22)
- I (11)
- a (22)
- abs (11)
- abs2 (11)
- acos (6)
- acosh (6)
- angle (11)
- arg (11)
- asin (6)
- asinh (6)
- atan (6)
- atan2 (6)
- atanh (6)
- base (11)
- between? (11)
- blockquote (22)
- cbrt (6)
- checkbox (22)
-
checkbox
_ group (22) - clamp (11)
- coerce (11)
- conj (11)
- conjugate (11)
- cos (6)
- cosh (6)
- denominator (11)
- exp (6)
- fdiv (28)
-
file
_ field (22) - finite? (8)
- form (44)
- hidden (22)
- html (22)
- i (11)
- imag (11)
- imaginary (11)
- img (22)
- infinite? (8)
- inspect (11)
-
json
_ create (11) - log (12)
- log10 (6)
- log2 (6)
- magnitude (11)
-
marshal
_ dump (11) -
multipart
_ form (44) - new (33)
- numerator (11)
- parse (11)
-
password
_ field (22) - phase (11)
- polar (22)
- quo (22)
-
radio
_ group (22) - rationalize (22)
- real (11)
- real? (11)
- rect (22)
- rectangular (22)
- reset (22)
-
scrolling
_ list (22) - signm (11)
- signo (11)
- sin (6)
- sinh (6)
- sqrt (6)
- submit (22)
- tan (6)
- tanh (6)
-
text
_ field (22) - textarea (22)
-
to
_ c (44) -
to
_ f (11) -
to
_ i (11) -
to
_ json (11) -
to
_ r (11) -
to
_ s (11) - tokenize (11)
- tr (11)
- trace (11)
検索結果
先頭5件
- Ripper
:: Lexer # lex -> [[Integer , Integer] , Symbol , String , Ripper :: Lexer :: State] - Ripper
:: Lexer # lex -> [[Integer , Integer] , Symbol , String] - Ripper
. lex(src , filename = & # 39;-& # 39; , lineno = 1 , raise _ errors: false) -> [[Integer , Integer] , Symbol , String , Ripper :: Lexer :: State] - Ripper
. lex(src , filename = & # 39;-& # 39; , lineno = 1) -> [[Integer , Integer] , Symbol , String , Ripper :: Lexer :: State] - Ripper
. lex(src , filename = & # 39;-& # 39; , lineno = 1) -> [[Integer , Integer] , Symbol , String]
-
Ripper
:: Lexer # lex -> [[Integer , Integer] , Symbol , String , Ripper :: Lexer :: State] (30507.0) -
自身の持つ Ruby プログラムをトークンに分割し、そのリストを返します。
...自身の持つ Ruby プログラムをトークンに分割し、そのリストを返します。
ライブラリ内部で使用します。 Ripper.lex を使用してください。... -
Ripper
:: Lexer # lex -> [[Integer , Integer] , Symbol , String] (30307.0) -
自身の持つ Ruby プログラムをトークンに分割し、そのリストを返します。
...自身の持つ Ruby プログラムをトークンに分割し、そのリストを返します。
ライブラリ内部で使用します。 Ripper.lex を使用してください。... -
Ripper
. lex(src , filename = & # 39;-& # 39; , lineno = 1 , raise _ errors: false) -> [[Integer , Integer] , Symbol , String , Ripper :: Lexer :: State] (24619.0) -
Ruby プログラム str をトークンに分割し、そのリストを返します。 ただし Ripper.tokenize と違い、トークンの種類と位置情報も付属します。
...m src Ruby プログラムを文字列か IO オブジェクトで指定します。
@param filename src のファイル名を文字列で指定します。省略すると "-" になります。
@param lineno src の開始行番号を指定します。省略すると 1 になります。
@param r......rror)を発生させます。省略すると false になります。
@raise SyntaxError raise_errors が true で、src に文法エラーがある場合に発生します。
//emlist[][ruby]{
require 'ripper'
pp Ripper.lex("def m(a) nil end")
# => [[[1, 0], :on_kw, "def", FNAME],
# [[1, 3......, :on_lparen, "(", BEG|LABEL],
# [[1, 6], :on_ident, "a", ARG],
# [[1, 7], :on_rparen, ")", ENDFN],
# [[1, 8], :on_sp, " ", BEG],
# [[1, 9], :on_kw, "nil", END],
# [[1, 12], :on_sp, " ", END],
# on_kw, "end", END
Ripper.lex("def req(true) end", raise_errors: true)
# => Synta... -
Ripper
. lex(src , filename = & # 39;-& # 39; , lineno = 1) -> [[Integer , Integer] , Symbol , String , Ripper :: Lexer :: State] (24613.0) -
Ruby プログラム str をトークンに分割し、そのリストを返します。 ただし Ripper.tokenize と違い、トークンの種類と位置情報も付属します。
...。
@param filename src のファイル名を文字列で指定します。省略すると "-" になります。
@param lineno src の開始行番号を指定します。省略すると 1 になります。
//emlist[][ruby]{
require 'ripper'
pp Ripper.lex("def m(a) nil end")
# => [[[1, 0], :o......], :on_lparen, "(", EXPR_BEG|EXPR_LABEL],
# [[1, 6], :on_ident, "a", EXPR_ARG],
# [[1, 7], :on_rparen, ")", EXPR_ENDFN],
# [[1, 8], :on_sp, " ", EXPR_BEG],
# [[1, 9], :on_kw, "nil", EXPR_END],
# [[1, 12], :on_sp, " ", EXPR_END],
# on_kw, "end", EXPR_END
//}
Ripper.lex は......の配列です。
: 種類 (Symbol)
トークンの種類が「:on_XXX」の形式のシンボルで渡されます。
: トークン (String)
トークン文字列です。
: ステート (Ripper::Lexer::State)
トークンの状態を表す Ripper::Lexer::State のインスタンス......@param filename src のファイル名を文字列で指定します。省略すると "-" になります。
@param lineno src の開始行番号を指定します。省略すると 1 になります。
//emlist[][ruby]{
require 'ripper'
pp Ripper.lex("def m(a) nil end")
# => [[[1, 0], :on_......ENDFN],
# [[1, 5], :on_lparen, "(", BEG|LABEL],
# [[1, 6], :on_ident, "a", ARG],
# [[1, 7], :on_rparen, ")", ENDFN],
# [[1, 8], :on_sp, " ", BEG],
# [[1, 9], :on_kw, "nil", END],
# [[1, 12], :on_sp, " ", END],
# on_kw, "end", END
//}
Ripper.lex は分割したトーク... -
Ripper
. lex(src , filename = & # 39;-& # 39; , lineno = 1) -> [[Integer , Integer] , Symbol , String] (24413.0) -
Ruby プログラム str をトークンに分割し、そのリストを返します。 ただし Ripper.tokenize と違い、トークンの種類と位置情報も付属します。
...param filename src のファイル名を文字列で指定します。省略すると "-" になります。
@param lineno src の開始行番号を指定します。省略すると 1 になります。
//emlist[][ruby]{
require 'ripper'
require 'pp'
pp Ripper.lex("def m(a) nil end")
# => [[[1,......[[1, 4], :on_ident, "m"],
# [[1, 5], :on_lparen, "("],
# [[1, 6], :on_ident, "a"],
# [[1, 7], :on_rparen, ")"],
# [[1, 8], :on_sp, " "],
# [[1, 9], :on_kw, "nil"],
# [[1, 12], :on_sp, " "],
# on_kw, "end"
//}
Ripper.lex は分割したトークンを詳しい情報......: 位置情報 (Integer,Integer)
トークンが置かれている行 (1-origin) と桁 (0-origin) の 2 要素の配列です。
: 種類 (Symbol)
トークンの種類が「:on_XXX」の形式のシンボルで渡されます。
: トークン (String)
トークン文字列です。... -
Complex
# >(other) -> bool (24200.0) -
@undef
@undef -
Kernel
. # Complex(r , i = 0) -> Complex (12500.0) -
実部が r、虚部が i である Complex クラスのオブジェクトを生成します。
...実部が r、虚部が i である Complex クラスのオブジェクトを生成します。
@param r 生成する複素数の実部。
@param i 生成する複素数の虚部。省略した場合は 0 です。
@param s 生成する複素数を表す文字列。
@raise ArgumentError 変換......発生します。
//emlist[例][ruby]{
Complex(1) # => (1+0i)
Complex(1, 2) # => (1+2i)
Complex('1+1i') # => (1+1i)
Complex('1+1j') # => (1+1i)
# Complex.polar(10, 10) と同一。
Complex('10@10') # => (-8.390715290764524-5.440211108893697i)
Complex('_') # => ArgumentError
//}
r......omplex(a, b) を a+bi として計算した Complex オブジェクトを返しま
す。
//emlist[例][ruby]{
Complex('1+1i', '2+3i') # => (-2+3i)
Complex('1+1i') + Complex('2+3i') * Complex('i') # => (-2+3i)
//}
@see Complex.rect、Complex.rectangular
[注意] Complex.n... -
Kernel
. # Complex(r , i = 0 , exception: true) -> Complex | nil (12500.0) -
実部が r、虚部が i である Complex クラスのオブジェクトを生成します。
...部が i である Complex クラスのオブジェクトを生成します。
@param r 生成する複素数の実部。
@param i 生成する複素数の虚部。省略した場合は 0 です。
@param s 生成する複素数を表す文字列。
@param exception false を指定すると、......わりに nil を返します。
@raise ArgumentError 変換できないオブジェクトを指定した場合に発生します。
//emlist[例][ruby]{
Complex(1) # => (1+0i)
Complex(1, 2) # => (1+2i)
Complex('1+1i') # => (1+1i)
Complex('1+1j') # => (1+1i)
# Complex.polar(10, 10) と......Complex('10@10') # => (-8.390715290764524-5.440211108893697i)
Complex('_') # => ArgumentError
//}
r にも i にも複素数と解釈されるオブジェクトを指定した場合には、
Complex(a, b) を a+bi として計算した Complex オブジェクトを返しま
す。
//emlist[... -
Kernel
. # Complex(s) -> Complex (12500.0) -
実部が r、虚部が i である Complex クラスのオブジェクトを生成します。
...実部が r、虚部が i である Complex クラスのオブジェクトを生成します。
@param r 生成する複素数の実部。
@param i 生成する複素数の虚部。省略した場合は 0 です。
@param s 生成する複素数を表す文字列。
@raise ArgumentError 変換......発生します。
//emlist[例][ruby]{
Complex(1) # => (1+0i)
Complex(1, 2) # => (1+2i)
Complex('1+1i') # => (1+1i)
Complex('1+1j') # => (1+1i)
# Complex.polar(10, 10) と同一。
Complex('10@10') # => (-8.390715290764524-5.440211108893697i)
Complex('_') # => ArgumentError
//}
r......omplex(a, b) を a+bi として計算した Complex オブジェクトを返しま
す。
//emlist[例][ruby]{
Complex('1+1i', '2+3i') # => (-2+3i)
Complex('1+1i') + Complex('2+3i') * Complex('i') # => (-2+3i)
//}
@see Complex.rect、Complex.rectangular
[注意] Complex.n... -
Kernel
. # Complex(s , exception: true) -> Complex | nil (12500.0) -
実部が r、虚部が i である Complex クラスのオブジェクトを生成します。
...部が i である Complex クラスのオブジェクトを生成します。
@param r 生成する複素数の実部。
@param i 生成する複素数の虚部。省略した場合は 0 です。
@param s 生成する複素数を表す文字列。
@param exception false を指定すると、......わりに nil を返します。
@raise ArgumentError 変換できないオブジェクトを指定した場合に発生します。
//emlist[例][ruby]{
Complex(1) # => (1+0i)
Complex(1, 2) # => (1+2i)
Complex('1+1i') # => (1+1i)
Complex('1+1j') # => (1+1i)
# Complex.polar(10, 10) と......Complex('10@10') # => (-8.390715290764524-5.440211108893697i)
Complex('_') # => ArgumentError
//}
r にも i にも複素数と解釈されるオブジェクトを指定した場合には、
Complex(a, b) を a+bi として計算した Complex オブジェクトを返しま
す。
//emlist[... -
CGI
:: HtmlExtension # file _ field(name = "" , size = 20 , maxlength = nil) -> String (12300.0) -
タイプが file である input 要素を生成します。
...file である input 要素を生成します。
@param name name 属性の値を指定します。
@param size size 属性の値を指定します。
@param maxlength maxlength 属性の値を指定します。
例:
file_field("name")
# <INPUT TYPE="file" NAME="name" SIZE="20">
file......_field("name", 40)
# <INPUT TYPE="file" NAME="name" SIZE="40">
file_field("name", 40, 100)
# <INPUT TYPE="file" NAME="name" SIZE="40" MAXLENGTH="100">... -
CGI
:: HtmlExtension # file _ field(attributes) -> String (12200.0) -
タイプが file である input 要素を生成します。
...タイプが file である input 要素を生成します。
@param attributes 属性をハッシュで指定します。
例:
file_field({ "NAME" => "name", "SIZE" => 40 })
# <INPUT TYPE="file" NAME="name" SIZE="40">... -
Complex
# <=>(other) -> -1 | 0 | 1 | nil (12200.0) -
self の虚部がゼロで other が実数の場合、 self の実部の <=> メソッドで other と比較した結果を返します。 other が Complex で虚部がゼロの場合も同様です。
...self の虚部がゼロで other が実数の場合、
self の実部の <=> メソッドで other と比較した結果を返します。
other が Complex で虚部がゼロの場合も同様です。
その他の場合は nil を返します。
@param other 自身と比較する数値
//emlis......t[例][ruby]{
Complex(2, 3) <=> Complex(2, 3) #=> nil
Complex(2, 3) <=> 1 #=> nil
Complex(2) <=> 1 #=> 1
Complex(2) <=> 2 #=> 0
Complex(2) <=> 3 #=> -1
//}... -
Complex
# >=(other) -> bool (12200.0) -
@undef
@undef -
Complex
# angle -> Float (12200.0) -
自身の偏角を[-π,π]の範囲で返します。
...す。
//emlist[例][ruby]{
Complex.polar(3, Math::PI/2).arg # => 1.5707963267948966
//}
非正の実軸付近での挙動に注意してください。以下の例のように虚部が 0.0 と
-0.0 では値が変わります。
//emlist[例][ruby]{
Complex(-1, 0).arg #=> 3.1415926......589793
Complex(-1, -0).arg #=> 3.141592653589793
Complex(-1, -0.0).arg #=> -3.141592653589793
Complex(0, 0.0).arg #=> 0.0
Complex(0, -0.0).arg #=> -0.0
Complex(-0.0, 0).arg #=> 3.141592653589793
Complex(-0.0, -0.0).arg #=> -3.141592...