クラス
- Array (48)
- Integer (24)
-
OpenSSL
:: BN (24) - OptionParser (144)
検索結果
先頭5件
-
Array
# shift -> object | nil (18133.0) -
配列の先頭の要素を取り除いてそれを返します。 引数を指定した場合はその個数だけ取り除き、それを配列で返します。
...。
@raise TypeError 引数に整数以外の(暗黙の型変換が行えない)オブジェクトを
指定した場合に発生します。
@raise ArgumentError 引数に負の数を指定した場合に発生します。
//emlist[例][ruby]{
a = [0, 1, 2, 3, 4]
p a.shift......#=> 0
p a #=> [1, 2, 3, 4]
p [].shift #=> nil
p [].shift(1) #=> []
//}
@see Array#push, Array#pop, Array#unshift... -
Array
# shift(n) -> Array (18133.0) -
配列の先頭の要素を取り除いてそれを返します。 引数を指定した場合はその個数だけ取り除き、それを配列で返します。
...。
@raise TypeError 引数に整数以外の(暗黙の型変換が行えない)オブジェクトを
指定した場合に発生します。
@raise ArgumentError 引数に負の数を指定した場合に発生します。
//emlist[例][ruby]{
a = [0, 1, 2, 3, 4]
p a.shift......#=> 0
p a #=> [1, 2, 3, 4]
p [].shift #=> nil
p [].shift(1) #=> []
//}
@see Array#push, Array#pop, Array#unshift... -
OpenSSL
:: BN # lshift!(n) -> self (6107.0) -
自身を n ビット左シフトします。 OpenSSL::BN#<<と異なり、破壊的メソッドです。
...す。
OpenSSL::BN#<<と異なり、破壊的メソッドです。
//emlist[][ruby]{
require 'openssl'
bn = 1.to_bn
bn.lshift!(2) # => #<OpenSSL::BN 4>
bn # => #<OpenSSL::BN 4>
//}
@param n シフトするビット数
@raise OpenSSL::BNError 計算時エラー
@see OpenSSL::BN#<<... -
OpenSSL
:: BN # rshift!(n) -> self (6107.0) -
自身を n ビット右シフトします。 [[m:OpenSSL::BN#>>]と異なり、破壊的メソッドです。
...[[m:OpenSSL::BN#>>]と異なり、破壊的メソッドです。
//emlist[][ruby]{
require 'openssl'
bn = 8.to_bn
bn.rshift!(1) # => #<OpenSSL::BN 4>
bn # => #<OpenSSL::BN 4>
//}
@param n シフトするビット数
@raise OpenSSL::BNError 計算時エラー
@see OpenSSL::BN#>>... -
Array
# pop -> object | nil (13.0) -
自身の末尾から要素を取り除いてそれを返します。 引数を指定した場合はその個数だけ取り除き、それを配列で返します。
...。
整数以外のオブジェクトを指定した場合は to_int メソッドによる暗
黙の型変換を試みます。
@raise TypeError 引数に整数以外の(暗黙の型変換が行えない)オブジェクトを
指定した場合に発生します......array = [1, [2, 3], 4]
p array.pop # => 4
p array.pop # => [2, 3]
p array # => [1]
p array.pop # => 1
p array.pop # => nil
p array # => []
array = [1, 2, 3]
p array.pop(2) #=> [2, 3]
p array #=> [1]
//}
@see Array#push, Array#shift, Array#unshift... -
Array
# pop(n) -> Array (13.0) -
自身の末尾から要素を取り除いてそれを返します。 引数を指定した場合はその個数だけ取り除き、それを配列で返します。
...。
整数以外のオブジェクトを指定した場合は to_int メソッドによる暗
黙の型変換を試みます。
@raise TypeError 引数に整数以外の(暗黙の型変換が行えない)オブジェクトを
指定した場合に発生します......array = [1, [2, 3], 4]
p array.pop # => 4
p array.pop # => [2, 3]
p array # => [1]
p array.pop # => 1
p array.pop # => nil
p array # => []
array = [1, 2, 3]
p array.pop(2) #=> [2, 3]
p array #=> [1]
//}
@see Array#push, Array#shift, Array#unshift... -
Integer
# chr -> String (13.0) -
self を文字コードとして見た時に、引数で与えたエンコーディング encoding に対応する文字を返します。
...Encoding:ASCII_8BIT>
//}
@param encoding エンコーディングを表すオブジェクト。Encoding::UTF_8、'shift_jis' など。
@return 一文字からなる文字列
@raise RangeError self を与えられたエンコーディングで正しく解釈できない場合に発生します... -
Integer
# chr(encoding) -> String (13.0) -
self を文字コードとして見た時に、引数で与えたエンコーディング encoding に対応する文字を返します。
...Encoding:ASCII_8BIT>
//}
@param encoding エンコーディングを表すオブジェクト。Encoding::UTF_8、'shift_jis' など。
@return 一文字からなる文字列
@raise RangeError self を与えられたエンコーディングで正しく解釈できない場合に発生します... -
OptionParser
# on(long , *rest) {|v| . . . } -> self (8.0) -
オプションを取り扱うためのブロックを自身に登録します。 ブロックはコマンドラインのパース時に、オプションが指定されていれば呼ばれます。
...説明と見なします。
//emlist[][ruby]{
opts.on("--protocol VALUE", [:http, :ftp, :https]){|w|
p w
}
# ruby command --protocol=http #=> :http
opts.on("-c", "--charset VALUE", {"jis" => "iso-2022-jp", "sjis" => "shift_jis"}){|w|
p w
}
# ruby command --charset=jis #=> "iso-2022-jp"
//}...