264件ヒット
[1-100件を表示]
(0.137秒)
種類
- インスタンスメソッド (192)
- クラス (36)
- 文書 (24)
- モジュール (12)
クラス
-
CSV
:: Row (6) - Data (6)
- Date (2)
- DateTime (2)
-
Encoding
:: Converter (120) - MatchData (6)
-
OpenSSL
:: ASN1 :: Primitive (24) - Struct (24)
- Time (2)
キーワード
- ASN1 (12)
- ASN1Data (12)
- Converter (12)
-
NEWS for Ruby 2
. 0 . 0 (12) - captures (2)
- convert (12)
- deconstruct (14)
-
deconstruct
_ keys (20) -
insert
_ output (12) -
last
_ error (12) -
primitive
_ convert (48) -
primitive
_ errinfo (12) - putback (24)
- tagging (12)
- tagging= (12)
-
to
_ a (6) - values (6)
- パターンマッチ (12)
検索結果
先頭5件
- OpenSSL
:: ASN1 :: Primitive - Encoding
:: Converter # primitive _ convert(source _ buffer , destination _ buffer) -> Symbol - Encoding
:: Converter # primitive _ convert(source _ buffer , destination _ buffer , destination _ byteoffset) -> Symbol - Encoding
:: Converter # primitive _ convert(source _ buffer , destination _ buffer , destination _ byteoffset , destination _ bytesize) -> Symbol - Encoding
:: Converter # primitive _ convert(source _ buffer , destination _ buffer , destination _ byteoffset , destination _ bytesize , options) -> Symbol
-
OpenSSL
:: ASN1 :: Primitive (24000.0) -
ASN.1 の単純型を表すクラスです。
ASN.1 の単純型を表すクラスです。
通常はこのクラス自身は用いず、各サブクラスを利用します。 -
Encoding
:: Converter # primitive _ convert(source _ buffer , destination _ buffer) -> Symbol (12352.0) -
エンコーディング変換のためのメソッドの中で、もっとも細かな扱いが可能なメソッドです。
...Encoding::Converter#primitive_convert が唯一の方法になります。
@param source_buffer 変換元文字列のバッファ
@param destination_buffer 変換先文字列を格納するバッファ
@param destination_byteoffset 変換先バッファでのオフセット
@param destination_bytes......ze 変換先バッファの容量
@param options 変換の詳細を指定する定数やハッシュ
@return 変換結果を表す Symbol
options には以下が指定できます。
: hash form
:partial_input => true # source buffer may be part of larger source
:after_output => true......op conversion after output before input
: integer form
Encoding::Converter::PARTIAL_INPUT
Encoding::Converter::AFTER_OUTPUT
戻り値は以下のうちのどれかです。
* :invalid_byte_sequence
* :incomplete_input
* :undefined_conversion
* :after_output
* :destination_buffer_full... -
Encoding
:: Converter # primitive _ convert(source _ buffer , destination _ buffer , destination _ byteoffset) -> Symbol (12352.0) -
エンコーディング変換のためのメソッドの中で、もっとも細かな扱いが可能なメソッドです。
...Encoding::Converter#primitive_convert が唯一の方法になります。
@param source_buffer 変換元文字列のバッファ
@param destination_buffer 変換先文字列を格納するバッファ
@param destination_byteoffset 変換先バッファでのオフセット
@param destination_bytes......ze 変換先バッファの容量
@param options 変換の詳細を指定する定数やハッシュ
@return 変換結果を表す Symbol
options には以下が指定できます。
: hash form
:partial_input => true # source buffer may be part of larger source
:after_output => true......op conversion after output before input
: integer form
Encoding::Converter::PARTIAL_INPUT
Encoding::Converter::AFTER_OUTPUT
戻り値は以下のうちのどれかです。
* :invalid_byte_sequence
* :incomplete_input
* :undefined_conversion
* :after_output
* :destination_buffer_full... -
Encoding
:: Converter # primitive _ convert(source _ buffer , destination _ buffer , destination _ byteoffset , destination _ bytesize) -> Symbol (12352.0) -
エンコーディング変換のためのメソッドの中で、もっとも細かな扱いが可能なメソッドです。
...Encoding::Converter#primitive_convert が唯一の方法になります。
@param source_buffer 変換元文字列のバッファ
@param destination_buffer 変換先文字列を格納するバッファ
@param destination_byteoffset 変換先バッファでのオフセット
@param destination_bytes......ze 変換先バッファの容量
@param options 変換の詳細を指定する定数やハッシュ
@return 変換結果を表す Symbol
options には以下が指定できます。
: hash form
:partial_input => true # source buffer may be part of larger source
:after_output => true......op conversion after output before input
: integer form
Encoding::Converter::PARTIAL_INPUT
Encoding::Converter::AFTER_OUTPUT
戻り値は以下のうちのどれかです。
* :invalid_byte_sequence
* :incomplete_input
* :undefined_conversion
* :after_output
* :destination_buffer_full... -
Encoding
:: Converter # primitive _ convert(source _ buffer , destination _ buffer , destination _ byteoffset , destination _ bytesize , options) -> Symbol (12352.0) -
エンコーディング変換のためのメソッドの中で、もっとも細かな扱いが可能なメソッドです。
...Encoding::Converter#primitive_convert が唯一の方法になります。
@param source_buffer 変換元文字列のバッファ
@param destination_buffer 変換先文字列を格納するバッファ
@param destination_byteoffset 変換先バッファでのオフセット
@param destination_bytes......ze 変換先バッファの容量
@param options 変換の詳細を指定する定数やハッシュ
@return 変換結果を表す Symbol
options には以下が指定できます。
: hash form
:partial_input => true # source buffer may be part of larger source
:after_output => true......op conversion after output before input
: integer form
Encoding::Converter::PARTIAL_INPUT
Encoding::Converter::AFTER_OUTPUT
戻り値は以下のうちのどれかです。
* :invalid_byte_sequence
* :incomplete_input
* :undefined_conversion
* :after_output
* :destination_buffer_full... -
Encoding
:: Converter # primitive _ errinfo -> Array (12307.0) -
直前の Encoding::Converter#primitive_convert による変換の結果を保持する五要素の配列を返します。
...直前の Encoding::Converter#primitive_convert による変換の結果を保持する五要素の配列を返します。
@return [result, enc1, enc2, error_bytes, readagain_bytes] という五要素の配列
result は直前の primitive_convert の戻り値です。
それ以外の四要素は......:invalid_byte_sequence か :incomplete_input か :undefined_conversion だった場合に意味を持ちます。
enc1 はエラーの発生した原始変換の変換元のエンコーディング、enc2 は変換先のエンコーディングです。
error_bytes はエラーの発生原因とな......ったバイト列、readagain_bytes は先読みによって変換器内部に保持されているバイト列です。
primitive_errinfo はもっぱら Encoding::Converter#primitive_convert と組み合わせて使います。Encoding::Converter#convert を用いている場合にも取得す... -
Encoding
:: Converter (9006.0) -
文字エンコーディング(文字符号化方式)の変換器のクラスです。既存の変換器より一段細かな処理が可能となります。
...ます。
Encoding::Converter を用いて変換を行う場合は、Encoding::Converter#convert か、より細かな変換処理が可能な Encoding::Converter#primitive_convert が利用できます。
エンコーディングを変換するメソッドはこの他に String#encode, NKF.#nkf... -
CSV
:: Row # deconstruct -> [object] (6206.0) -
パターンマッチに使用する行の値の配列を返します。
...//emlist[例][ruby]{
require "csv"
row = CSV::Row.new(["header1", "header2", "header3"], [1, 2, 3])
case row
in [2.., 2.., 2..]
puts "all 2 or more"
in [...2, 2.., 2..]
puts "first column is less than 2, and rest columns are 2 or more"
end
#=> "first column is less than 2, and rest columns are 2......or more" が出力される
//}
@see d:spec/pattern_matching#matching_non_primitive_objects... -
Data
# deconstruct -> [object] (6206.0) -
self のメンバの値を配列で返します。
...elf のメンバの値を配列で返します。
//emlist[例][ruby]{
Measure = Data.define(:amount, :unit)
distance = Measure.new(10, 'km')
distance.deconstruct # => [10, "km"]
//}
このメソッドは以下のようにパターンマッチで利用されます。
//emlist[例][ruby]{
Measure......define(:amount, :unit)
distance = Measure.new(10, 'km')
case distance
in n, 'km' # 裏側で #deconstruct を呼ぶ
puts "It is #{n} kilometers away"
else
puts "Don't know how to handle it"
end
# "It is 10 kilometers away" が表示される
# 以下のようにも書ける
case distance
in Me.........
end
//}
[注意] 本メソッドの記述は Data のサブクラスのインスタンスに対して呼び
出す事を想定しています。Data.define は Data のサブクラスを作成する点に
注意してください。
@see d:spec/pattern_matching#matching_non_primitive_objects... -
Struct
# deconstruct -> [object] (6206.0) -
構造体のメンバの値を配列にいれて返します。
...構造体のメンバの値を配列にいれて返します。
//emlist[例][ruby]{
Customer = Struct.new(:name, :address, :zip)
Customer.new("Joe Smith", "123 Maple, Anytown NC", 12345).to_a
# => ["Joe Smith", "123 Maple, Anytown NC", 12345]
//}
[注意] 本メソッドの記述は Struct の下......位クラスのインスタンスに対して呼び
出す事を想定しています。Struct.new は Struct の下位クラスを作成する点に
注意してください。
@see d:spec/pattern_matching#matching_non_primitive_objects... -
Encoding
:: Converter # insert _ output(string) -> nil (6154.0) -
変換器内のバッファに文字列を挿入します。 バッファに保持された文字列は、次の変換時の変換結果と一緒に返されます。
...//emlist[][ruby]{
ec = Encoding::Converter.new("utf-8", "iso-8859-1")
src = "HIRAGANA LETTER A is \u{3042}."
dst = ""
p ec.primitive_convert(src, dst) #=> :undefined_conversion
puts "[#{dst.dump}, #{src.dump}]" #=> ["HIRAGANA LETTER A is ", "."]
ec.insert_output("<err>")
p ec.primitive_convert......=> :finished
puts "[#{dst.dump}, #{src.dump}]" #=> ["HIRAGANA LETTER A is <err>.", ""]
ec = Encoding::Converter.new("utf-8", "iso-2022-jp")
src = "\u{306F 3041 3068 2661 3002}" # U+2661 is not representable in iso-2022-jp
dst = ""
p ec.primitive_convert(src, dst) #=> :undefined_conversion
puts.......dump}]" #=> ["\e$B$O$!$H".force_encoding("ISO-2022-JP"), "\xE3\ x80\x82"]
ec.insert_output "?" # state change required to output "?".
p ec.primitive_convert(src, dst) #=> :finished
puts "[#{dst.dump}, #{src.dump}]" #=> ["\e$B$O$!$H\e(B?\e$B!#\e(B".force_encoding("ISO-20...