種類
- インスタンスメソッド (177)
- 文書 (24)
- クラス (24)
- モジュール (12)
クラス
-
CSV
:: Row (3) - Data (6)
- Date (2)
- DateTime (2)
-
Encoding
:: Converter (108) - MatchData (6)
-
OpenSSL
:: ASN1 :: Primitive (24) - Struct (24)
- Time (2)
キーワード
- ASN1 (12)
- ASN1Data (12)
-
NEWS for Ruby 2
. 0 . 0 (12) - captures (2)
- deconstruct (11)
-
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 (21000.0) -
ASN.1 の単純型を表すクラスです。
...ASN.1 の単純型を表すクラスです。
通常はこのクラス自身は用いず、各サブクラスを利用します。... -
OpenSSL
:: ASN1 :: Primitive # tagging=(tagging) (9206.0) -
タグ付けの方式を設定します。
...タグ付けの方式を設定します。
@param tagging タグ付けの方式(:IMPLICIT または :EXPLICIT)
@see OpenSSL::ASN1::Primitive#tagging=... -
MatchData
# captures -> [String] (9124.0) -
$1, $2, ... を格納した配列を返します。
...す。
MatchData#to_a と異なり $& を要素に含みません。
グループにマッチした部分文字列がなければ対応する要素は nil になります。
//emlist[例][ruby]{
/(foo)(bar)(BAZ)?/ =~ "foobarbaz"
p $~.to_a # => ["foobar", "foo", "bar", nil]
p $~.captures #......=> ["foo", "bar", nil]
//}
@see MatchData#to_a, MatchData#named_captures, d:spec/pattern_matching#matching_non_primitive_objects... -
OpenSSL
:: ASN1 :: Primitive # tagging -> Symbol | nil (9106.0) -
タグ付けの方式を返します。
...タグ付けの方式を返します。
:IMPLICIT、:EXPLICIT、nil のいずれかを返します。
タグ(OpenSSL::ASN1::ASN1Data#tag)が :UNIVERSAL ならば
この値は無視されます。
nil は :IMPLICIT と同義です。
@see OpenSSL::ASN1::Primitive#tagging=... -
OpenSSL
:: ASN1 :: ASN1Data (9006.0) -
ASN.1 データ型を表すクラス。
...ASN.1 データ型を表すクラス。
UNIVERSAL なタグを持つ ASN.1 値はこのクラスの2つのサブクラス、
OpenSSL::ASN1::Primitive もしくは OpenSSL::ASN1::Constructive
のインスタンスとして表現されます。
それ以外の値はこのクラスのインスタン... -
Encoding
:: Converter # primitive _ convert(source _ buffer , destination _ buffer , destination _ byteoffset , destination _ bytesize) -> Symbol (6452.0) -
エンコーディング変換のためのメソッドの中で、もっとも細かな扱いが可能なメソッドです。
...ing::Converter#primitive_convert が唯一の方法になります。
@param source_buffer 変換元文字列のバッファ
@param destination_buffer 変換先文字列を格納するバッファ
@param destination_byteoffset 変換先バッファでのオフセット
@param destination_bytesize......@param options 変換の詳細を指定する定数やハッシュ
@return 変換結果を表す Symbol
options には以下が指定できます。
: hash form
:partial_input => true # source buffer may be part of larger source
:after_output => true # stop conversion aft......re input
: integer form
Encoding::Converter::PARTIAL_INPUT
Encoding::Converter::AFTER_OUTPUT
戻り値は以下のうちのどれかです。
* :invalid_byte_sequence
* :incomplete_input
* :undefined_conversion
* :after_output
* :destination_buffer_full
* :source_buffer_empty
* :... -
Encoding
:: Converter # primitive _ convert(source _ buffer , destination _ buffer , destination _ byteoffset , destination _ bytesize , options) -> Symbol (6452.0) -
エンコーディング変換のためのメソッドの中で、もっとも細かな扱いが可能なメソッドです。
...ing::Converter#primitive_convert が唯一の方法になります。
@param source_buffer 変換元文字列のバッファ
@param destination_buffer 変換先文字列を格納するバッファ
@param destination_byteoffset 変換先バッファでのオフセット
@param destination_bytesize......@param options 変換の詳細を指定する定数やハッシュ
@return 変換結果を表す Symbol
options には以下が指定できます。
: hash form
:partial_input => true # source buffer may be part of larger source
:after_output => true # stop conversion aft......re input
: integer form
Encoding::Converter::PARTIAL_INPUT
Encoding::Converter::AFTER_OUTPUT
戻り値は以下のうちのどれかです。
* :invalid_byte_sequence
* :incomplete_input
* :undefined_conversion
* :after_output
* :destination_buffer_full
* :source_buffer_empty
* :... -
パターンマッチ (6400.0)
-
パターンマッチ * patterns * variable_binding * variable_pinning * matching_non_primitive_objects * guard_clauses * current_feature_status * pattern_syntax * some_undefined_behavior_examples
...パターンマッチ
* patterns
* variable_binding
* variable_pinning
* matching_non_primitive_objects
* guard_clauses
* current_feature_status
* pattern_syntax
* some_undefined_behavior_examples
パターンマッチは、構造化された値に対して、構造をチェック......<expression> in <pattern>
case 文の中で利用できます。
case <expression>
in <pattern1>
...
in <pattern2>
...
in <pattern3>
...
else
...
end
in 節と when 節は1つの case 式の中に混ぜて書くことはできません。
case/in 式は 「網羅......case 式の値がどの節にもマッチせず else 節がない場合、例外 NoMatchingPatternError が発生します。
そのため、条件付きのマッチや展開に case 式が使われることがあります。
//emlist[][ruby]{
config = {db: {user: 'admin', password: 'abc123'}}
ca......りません)
Rubyでのパターンマッチは case/in 式を用いて実装されています。
case <expression>
in <pattern1>
...
in <pattern2>
...
in <pattern3>
...
else
...
end
in 節と when 節は1つの case 式の中に混ぜて書くことはできませ......expression> => <pattern>
<expression> in <pattern>
case/in 式は 「網羅的」 です。もし case 式の値がどの節にもマッチせず else 節がない場合、例外 NoMatchingPatternError が発生します。
そのため、条件付きのマッチや展開に case 式が使わ... -
Encoding
:: Converter # primitive _ convert(source _ buffer , destination _ buffer , destination _ byteoffset) -> Symbol (6352.0) -
エンコーディング変換のためのメソッドの中で、もっとも細かな扱いが可能なメソッドです。
...ing::Converter#primitive_convert が唯一の方法になります。
@param source_buffer 変換元文字列のバッファ
@param destination_buffer 変換先文字列を格納するバッファ
@param destination_byteoffset 変換先バッファでのオフセット
@param destination_bytesize......@param options 変換の詳細を指定する定数やハッシュ
@return 変換結果を表す Symbol
options には以下が指定できます。
: hash form
:partial_input => true # source buffer may be part of larger source
:after_output => true # stop conversion aft......re input
: integer form
Encoding::Converter::PARTIAL_INPUT
Encoding::Converter::AFTER_OUTPUT
戻り値は以下のうちのどれかです。
* :invalid_byte_sequence
* :incomplete_input
* :undefined_conversion
* :after_output
* :destination_buffer_full
* :source_buffer_empty
* :... -
パターンマッチ (6346.0)
-
パターンマッチ * patterns * variable_binding * variable_pinning * matching_non_primitive_objects * guard_clauses * current_feature_status * pattern_syntax * some_undefined_behavior_examples
...パターンマッチ
* patterns
* variable_binding
* variable_pinning
* matching_non_primitive_objects
* guard_clauses
* current_feature_status
* pattern_syntax
* some_undefined_behavior_examples
パターンマッチは、構造化された値に対して、構造をチェック......りません)
Rubyでのパターンマッチは case/in 式を用いて実装されています。
case <expression>
in <pattern1>
...
in <pattern2>
...
in <pattern3>
...
else
...
end
in 節と when 節は1つの case 式の中に混ぜて書くことはできませ......expression> => <pattern>
<expression> in <pattern>
case/in 式は 「網羅的」 です。もし case 式の値がどの節にもマッチせず else 節がない場合、例外 NoMatchingPatternError が発生します。
そのため、条件付きのマッチや展開に case 式が使わ... -
Encoding
:: Converter # primitive _ errinfo -> Array (6319.0) -
直前の Encoding::Converter#primitive_convert による変換の結果を保持する五要素の配列を返します。
...::Converter#primitive_convert による変換の結果を保持する五要素の配列を返します。
@return [result, enc1, enc2, error_bytes, readagain_bytes] という五要素の配列
result は直前の primitive_convert の戻り値です。
それ以外の四要素は :invalid_byte_seq......error_bytes はエラーの発生原因となったバイト列、readagain_bytes は先読みによって変換器内部に保持されているバイト列です。
primitive_errinfo はもっぱら Encoding::Converter#primitive_convert と組み合わせて使います。Encoding::Converter#con......by]{
# \xff is invalid as EUC-JP.
ec = Encoding::Converter.new("EUC-JP", "Shift_JIS")
ec.primitive_convert(src="\xff", dst="", nil, 10)
p ec.primitive_errinfo
#=> [:invalid_byte_sequence, "EUC-JP", "Shift_JIS", "\xFF", ""]
# HIRAGANA LETTER A (\xa4\xa2 in EUC-JP) is not representable in ISO-8859-1....