種類
- インスタンスメソッド (118)
- 文書 (22)
- モジュール関数 (11)
ライブラリ
- ビルトイン (107)
-
rexml
/ document (11) -
ripper
/ filter (11)
クラス
- Array (19)
-
REXML
:: Elements (11) -
Ripper
:: Filter (11) - String (11)
モジュール
- Enumerable (66)
- Math (11)
キーワード
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (11) - gamma (11)
- pack (19)
- pack テンプレート文字列 (11)
- parse (11)
- reduce (33)
- unpack (11)
検索結果
先頭5件
-
Array
# pack(template , buffer: String . new) -> String (6.0) -
配列の内容を template で指定された文字列にしたがって、 バイナリとしてパックした文字列を返します。
...""
[82, 117, 98, 121].each {|c| s << c}
s # => "Ruby"
[82, 117, 98, 121].collect {|c| sprintf "%c", c}.join # => "Ruby"
[82, 117, 98, 121].inject("") {|s, c| s << c} # => "Ruby"
//}
: 文字列を数値(文字コード)の配列に変換する例
//emlist[][ruby]{
"Ruby".unpack('C*')... -
Math
. # gamma(x) -> Float (6.0) -
x のガンマ関数の値を返します。
...発生します。
@raise RangeError xに実数以外の数値を指定した場合に発生します。
//emlist[例][ruby]{
def fact(n) (1..n).inject(1) {|r,i| r*i } end
1.upto(26) {|i| p [i, Math.gamma(i), fact(i-1)] }
# => [1, 1.0, 1]
# [2, 1.0, 1]
# [3, 2.0, 2]
# [4, 6.0, 6]
# [5, 24.... -
Ripper
:: Filter # parse(init = nil) -> object (6.0) -
自身の持つ Ruby プログラムの解析を開始します。各種イベントハンドラで処 理を行った結果を返します。
...てイベントハンドラに渡されていきます。各種イベン
トハンドラの戻り値は次のイベントハンドラに渡されます。
Enumerable#inject のように、最終的な結果を戻り値として返します。
@see Ripper::Filter#on_default, Ripper::Filter#on_XXX... -
String
# unpack(template) -> Array (6.0) -
Array#pack で生成された文字列を テンプレート文字列 template にしたがってアンパックし、 それらの要素を含む配列を返します。
...""
[82, 117, 98, 121].each {|c| s << c}
s # => "Ruby"
[82, 117, 98, 121].collect {|c| sprintf "%c", c}.join # => "Ruby"
[82, 117, 98, 121].inject("") {|s, c| s << c} # => "Ruby"
//}
: 文字列を数値(文字コード)の配列に変換する例
//emlist[][ruby]{
"Ruby".unpack('C*')... -
pack テンプレート文字列 (6.0)
-
pack テンプレート文字列
...""
[82, 117, 98, 121].each {|c| s << c}
s # => "Ruby"
[82, 117, 98, 121].collect {|c| sprintf "%c", c}.join # => "Ruby"
[82, 117, 98, 121].inject("") {|s, c| s << c} # => "Ruby"
//}
: 文字列を数値(文字コード)の配列に変換する例
//emlist[][ruby]{
"Ruby".unpack('C*')...