33件ヒット
[1-33件を表示]
(0.068秒)
キーワード
- Integer (11)
-
urlsafe
_ decode64 (11) -
urlsafe
_ encode64 (11)
検索結果
先頭4件
-
Base64
. # urlsafe _ encode64(bin , padding: true) -> String (9147.0) -
与えられたデータを Base64 エンコードした文字列を返します。
...与えられたデータを Base64 エンコードした文字列を返します。
このメソッドは 4648 の "Base 64 Encoding with URL and Filename Safe Alphabet" に対応しています。
"+" を "-" に "/" を "_" に置き換えます。
デフォルトでは戻り値は = による......プションに false を指定してください。
@param bin Base64 エンコードするデータを指定します。
@param padding false を指定した場合、 = によるパディングが行われなくなります。
//emlist[例][ruby]{
require 'base64'
p Base64.urlsafe_encode64('hog......e')
# => "aG9nZQ=="
p Base64.urlsafe_encode64('hoge', padding: false)
# => "aG9nZQ"
//}... -
Base64
. # urlsafe _ decode64(str) -> String (9135.0) -
与えられた文字列を Base64 デコードしたデータを返します。
...与えられた文字列を Base64 デコードしたデータを返します。
このメソッドは 4648 の "Base 64 Encoding with URL and Filename Safe Alphabet" に対応しています。
"+" を "-" に "/" を "_" に置き換えます。
@param str Base64 デコードする文字列を......定します。
@raise ArgumentError 与えられた引数が Base64 エンコードされたデータとして正しい形式ではない場合に発生します。
例えば、アルファベットでない文字列や CR, LF などが含まれている場合にこの例外は発生しま... -
Kernel
. # Integer(arg , base = 0 , exception: true) -> Integer | nil (3208.0) -
引数を整数 に変換した結果を返します。
...に対しては arg.to_int, arg.to_i を
この順に使用して変換します。
@param arg 変換対象のオブジェクトです。
@param base 基数として0か2から36の整数を指定します(引数argに文字列を指
定した場合のみ)。省略するか0を指定......、0o (8 進数)、0d (10 進数)、0x (16 進
数) です。
@param exception false を指定すると、変換できなかった場合、
例外を発生する代わりに nil を返します。
@raise ArgumentError 整数と見なせない文字列を引数に指定......に発生します。
@raise TypeError 引数に nil を指定した場合に発生します。
//emlist[例][ruby]{
p Integer(4) #=> 4
p Integer(4_000) #=> 4000
p Integer(9.88) #=> 9
p Integer(nil) # can't convert nil into Integer (TypeError)
p Integer(Object.new) # can... -
Kernel
. # Integer(arg , base = 0) -> Integer (3108.0) -
引数を整数 (Fixnum,Bignum) に変換した結果を返します。
...に対しては arg.to_int, arg.to_i を
この順に使用して変換します。
@param arg 変換対象のオブジェクトです。
@param base 基数として0か2から36の整数を指定します(引数argに文字列を指
定した場合のみ)。省略するか0を指定......に発生します。
@raise TypeError 引数に nil を指定した場合に発生します。
//emlist[例][ruby]{
p Integer(4) #=> 4
p Integer(4_000) #=> 4000
p Integer(9.88) #=> 9
p Integer(nil) # can't convert nil into Integer (TypeError)
p Integer(Object.new) # can......類は無視される
p Integer("1\n0") # `Integer': invalid value for Integer: "1\n0" (ArgumentError)
p Integer("hoge") # `Integer': invalid value for Integer: "hoge" (ArgumentError)
p Integer("") # `Integer': invalid value for Integer: "" (ArgumentError)
//}
@see String#hex,String...