るりまサーチ

最速Rubyリファレンスマニュアル検索!
24件ヒット [1-24件を表示] (0.050秒)

別のキーワード

  1. kernel require
  2. getoptlong require_order
  3. rubygems/custom_require require
  4. irb/ext/use-loader irb_require
  5. require execute

ライブラリ

クラス

検索結果

IPAddr#native -> self | IPAddr (18113.0)

IPv4 射影 IPv6 アドレスや IPv4 互換 IPv6 アドレスから、 IPv4 アドレスの新しい IPAddr オブジェクトを返します。 IPv4 互換でも IPv4 組み込みでもないなら self を返します。

...IPv4 アドレスの新しい IPAddr オブジェクトを返します。
IPv4 互換でも IPv4 組み込みでもないなら self を返します。

例:

require
"ipaddr"
p IPAddr.new("0000:0000:0000:0000:0000:ffff:c0a8:0001").native
# => #<IPAddr: IPv4:192.168.0.1/255.255.255.255>...

CSV (30.0)

このクラスは CSV ファイルやデータに対する完全なインターフェイスを提供します。

...クラスは CSV ファイルやデータに対する完全なインターフェイスを提供します。

=== 読み込み

//emlist[][ruby]{
require
"csv"

csv_text = <<~CSV_TEXT
Ruby,1995
Rust,2010
CSV_TEXT

IO.write "sample.csv", csv_text

# ファイルから一行ずつ
CSV.foreach("samp...
...ust", "2010"]

# 文字列から一度に
p CSV.parse(csv_text)
# => [["Ruby", "1995"], ["Rust", "2010"]]
//}

=== 書き込み

//emlist[][ruby]{
require
'csv'

# ファイルへ書き込み
CSV.open("path/to/file.csv", "wb") do |csv|
csv << ["row", "of", "CSV", "data"]
csv << ["another", "row"...
...ersions.
Again, you can provide custom converters that are aware of your Encodings to
avoid this translation. It's just too hard for me to support native
conversions in all of Ruby's Encodings.

Anyway, the practical side of this is simple: make sure IO and String objects
passed into CSV have the...