クラス
- CSV (11)
- Encoding (11)
-
Encoding
:: Converter (66) -
Enumerator
:: Lazy (291) -
RDoc
:: Options (33) - Regexp (11)
- String (75)
モジュール
- Enumerable (11)
-
Gem
:: InstallUpdateOptions (11)
キーワード
- chunk (22)
- collect (11)
-
collect
_ concat (11) - convert (11)
- drop (11)
-
drop
_ while (11) - encode (33)
- filter (6)
-
filter
_ map (5) -
find
_ all (11) -
fixed
_ encoding? (11) -
flat
_ map (11) -
force
_ encoding (11) -
force
_ output (11) -
force
_ output= (11) -
force
_ quotes? (11) -
force
_ update (11) - grep (11)
-
grep
_ v (9) -
insert
_ output (11) -
install
_ update _ defaults _ str (11) - iseuc (11)
- lazy (11)
- map (11)
-
primitive
_ convert (44) - reject (11)
- replicate (11)
- select (11)
-
slice
_ after (20) -
slice
_ before (33) -
slice
_ when (10) - take (11)
-
take
_ while (22) -
unicode
_ normalize (10) -
unicode
_ normalized? (10) -
with
_ index (10) - zip (22)
検索結果
先頭5件
-
Enumerator
:: Lazy # force(*args) -> [object] (21108.0) -
全ての要素を含む配列を返します。Lazy から実際に値を取り出すのに使います。
...の要素を含む配列を返します。Lazy から実際に値を取り出すのに使います。
Enumerable#to_a のエイリアスです。
//emlist[例][ruby]{
1.step.lazy.take(10).force
# => [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
1.step.lazy.take(10).to_a
# => [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
//}... -
RDoc
:: Options # force _ output -> bool (18334.0) -
コマンドライン引数の --force_output オプションを指定していた場合、true を返します。--no-force_output オプションを指定していた場合、false を返 します。
...コマンドライン引数の --force_output オプションを指定していた場合、true
を返します。--no-force_output オプションを指定していた場合、false を返
します。
どちらも指定しなかった場合は true を返します。... -
RDoc
:: Options # force _ output=(val) (18324.0) -
val に true を指定した場合、コマンドライン引数の --force_output オプショ ンと同様の指定を行います。
...val に true を指定した場合、コマンドライン引数の --force_output オプショ
ンと同様の指定を行います。
@param val --force_output オプションと同じ指定を行う場合は true、そうで
ない場合は false を指定します。... -
Encoding
:: Converter # insert _ output(string) -> nil (12231.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.primiti......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 "[#{dst.dum......p}, #{src.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("... -
CSV
# force _ quotes? -> bool (12226.0) -
出力される全てのフィールドがクオートされる場合は、真を返します。
...st[例][ruby]{
require "csv"
rows = [["header1", "header2"], ["row1_1,", "row1_2"]]
result = CSV.generate(force_quotes: false) do |csv|
rows.each { |row| csv << row }
csv.force_quotes? # => false
end
print result
# => header1,header2
# "row1_1,",row1_2
//}
//emlist[例][ruby]{
require "csv......"
rows = [["header1", "header2"], ["row1_1,", "row1_2"]]
result = CSV.generate(force_quotes: true) do |csv|
rows.each { |row| csv << row }
csv.force_quotes? # => true
end
print result
# => true
# => "header1","header2"
# "row1_1,","row1_2"
//}
@see CSV.new... -
RDoc
:: Options # force _ update -> bool (12218.0) -
コマンドライン引数の --force_update を指定していた場合に true を返しま す。そうでない場合は false を返します。
...コマンドライン引数の --force_update を指定していた場合に true を返しま
す。そうでない場合は false を返します。... -
Gem
:: InstallUpdateOptions # install _ update _ defaults _ str -> String (9107.0) -
Gem コマンドの install サブコマンドに渡されるデフォルトのオプションを返します。
...Gem コマンドの install サブコマンドに渡されるデフォルトのオプションを返します。
デフォルトのオプションは以下の通りです。
--rdoc --no-force --no-test --wrappers... -
String
# force _ encoding(encoding) -> self (6150.0) -
文字列の持つエンコーディング情報を指定された encoding に変えます。
...][ruby]{
s = [164, 164, 164, 237, 164, 207].pack("C*")
p s.encoding #=> ASCII-8BIT
p s.force_encoding("EUC-JP") #=> "いろは"
p s.force_encoding(Encoding::EUC_JP) #=> "いろは"
u = [12411, 12408, 12392].pack("U*")
u.force_encoding("UTF-......8") #=> "ほへと"
u.force_encoding(Encoding::UTF_8) #=> "ほへと"
//}... -
String
# unicode _ normalize(form = :nfc) -> String (6143.0) -
self を NFC、NFD、NFKC、NFKD のいずれかの正規化形式で Unicode 正規化し た文字列を返します。
...の正規化形式で Unicode 正規化し
た文字列を返します。
@param form 正規化形式を :nfc、:nfd、:nfkc、:nfkd のいずれかで指定しま
す。省略した場合は :nfc になります。
@raise Encoding::CompatibilityError self が Unicode 文字列では......ドでの "Unicode 文字列" とは、UTF-8、UTF-16BE/LE、
UTF-32BE/LE だけではなく GB18030、UCS_2BE、and UCS_4BE を含みます。
また、self が UTF-8 以外のエンコーディングであった場合は一度 UTF-8 に変
換してから正規化されるため、UTF-8 よりも......います。
//emlist[例][ruby]{
"a\u0300".unicode_normalize # => 'à' ("\u00E0" と同じ)
"a\u0300".unicode_normalize(:nfc) # => 'à' ("\u00E0" と同じ)
"\u00E0".unicode_normalize(:nfd) # => 'à' ("a\u0300" と同じ)
"\xE0".force_encoding('ISO-8859-1').unicode_normalize(:nfd)... -
String
# unicode _ normalized?(form = :nfc) -> bool (6131.0) -
self が引数 form で指定された正規化形式で Unicode 正規化された文字列か どうかを返します。
...規化形式で Unicode 正規化された文字列か
どうかを返します。
@param form 正規化形式を :nfc、:nfd、:nfkc、:nfkd のいずれかで指定しま
す。省略した場合は :nfc になります。
@raise Encoding::CompatibilityError self が Unicode 文字......生します。
//emlist[例][ruby]{
"a\u0300".unicode_normalized? # => false
"a\u0300".unicode_normalized?(:nfd) # => true
"\u00E0".unicode_normalized? # => true
"\u00E0".unicode_normalized?(:nfd) # => false
"\xE0".force_encoding('ISO-8859-1').unicode_normalized?......# => Encoding::CompatibilityError raised
//}
@see String#unicode_normalize, String#unicode_normalize!...