るりまサーチ

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

別のキーワード

  1. _builtin to_s
  2. openssl to_der
  3. openssl to_s
  4. _builtin to_a
  5. openssl to_pem

ライブラリ

クラス

キーワード

検索結果

<< 1 2 > >>

Zlib::GzipWriter#write(*str) -> Integer (24136.0)

自身に str を出力します。str が文字列でなけ れば to_s による文字列化を試みます。

...れば to_s による文字列化を試みます。

@param str 出力する文字列を指定します。文字列でない場合は to_s で文字列に変換します。

@return 実際に出力できたバイト数を返します。

require 'zlib'

filename='hoge1.gz'
fw = File.open(file...
...name, "w")
Zlib::GzipWriter.wrap(fw, Zlib::BEST_COMPRESSION){|gz|
gz.write "foo"
}
fr = File.open(filename)
Zlib::GzipReader.wrap(fr){|gz|
p
uts gz.read
}
#=> foo

@see IO#write...

Zlib::GzipWriter#write(str) -> Integer (24136.0)

自身に str を出力します。str が文字列でなけ れば to_s による文字列化を試みます。

...れば to_s による文字列化を試みます。

@param str 出力する文字列を指定します。文字列でない場合は to_s で文字列に変換します。

@return 実際に出力できたバイト数を返します。

require 'zlib'

filename='hoge1.gz'
fw = File.open(file...
...name, "w")
Zlib::GzipWriter.wrap(fw, Zlib::BEST_COMPRESSION){|gz|
gz.write "foo"
}
fr = File.open(filename)
Zlib::GzipReader.wrap(fr){|gz|
p
uts gz.read
}
#=> foo

@see IO#write...

Pathname#write(string, offset=nil, **opts) -> Integer (21220.0)

...IO.write(self.to_s, string, offset, **opts)と同じです。

@see IO.write...

REXML::Entity#to_s -> String (18120.0)

実体宣言を文字列化したものを返します。

...実体宣言を文字列化したものを返します。

@see REXML::Entity#write

//emlist[][ruby]{
e = REXML::ENTITY.new("w", "wee");
p
e.to_s # => "<!ENTITY w \"wee\">"
//}...

CSV::Table#to_s(options = Hash.new) -> String (15226.0)

CSV の文字列に変換して返します。

...す。オプションに :write_headers =>
false を指定するとヘッダを出力しません。

//emlist[][ruby]{
require 'csv'
csv = CSV.new("a,b,c\n1,2,3", headers: true)
table = csv.read
p
table.to_csv # => "a,b,c\n1,2,3\n"
p
table.to_csv(write_headers: false) # => "1,...

絞り込み条件を変える

Pathname#binwrite(string, offset=nil) -> Integer (9117.0)

IO.binwrite(self.to_s, *args)と同じです。

...IO.binwrite(self.to_s, *args)と同じです。


@see IO.binwrite...

Zlib::GzipWriter#<<(str) -> self (6017.0)

str を出力します。str が文字列でない場合は to_s を用いて 文字列に変換します。

...合は to_s を用いて
文字列に変換します。

@param str 出力したいオブジェクトを与えます。

require 'zlib'

filename='hoge1.gz'
fw = File.open(filename, "w")
Zlib::GzipWriter.wrap(fw, Zlib::BEST_COMPRESSION){|gz|
gz << "hoge" << "fuga"
}
fr = File.open(fi...
...lename)
Zlib::GzipReader.wrap(fr){|gz|
p
uts gz.read
}
#=> hogefuga

@see IO#<<...

Pathname#each_line(*args) -> Enumerator (3059.0)

IO.foreach(self.to_s, *args, &block) と同じです。

...reach(self.to_s, *args, &block) と同じです。

//emlist[例][ruby]{
require "pathname"

IO.write("testfile", "line1\nline2,\nline3\n")
P
athname("testfile").each_line
# => #<Enumerator: IO:foreach("testfile")>
//}

//emlist[例 ブロックを指定][ruby]{
require "pathname"

IO.write("testfile...
...", "line1\nline2,\nline3\n")
P
athname("testfile").each_line {|f| p f }

# => "line1\n"
# => "line2,\n"
# => "line3\n"
//}

//emlist[例 limit を指定][ruby]{
require "pathname"

IO.write("testfile", "line1\nline2,\nline3\n")
P
athname("testfile").each_line(4) {|f| p f }

# => "line"
# => "1\n"
# =>...
..."line"
# => "2,\n"
# => "line"
# => "3\n"
//}

//emlist[例 sep を指定][ruby]{
require "pathname"

IO.write("testfile", "line1\nline2,\nline3\n")
P
athname("testfile").each_line(",") {|f| p f }

# => "line1\nline2,"
# => "\nline3\n"
//}

@see IO.foreach...

Pathname#each_line(*args) {|line| ... } -> nil (3059.0)

IO.foreach(self.to_s, *args, &block) と同じです。

...reach(self.to_s, *args, &block) と同じです。

//emlist[例][ruby]{
require "pathname"

IO.write("testfile", "line1\nline2,\nline3\n")
P
athname("testfile").each_line
# => #<Enumerator: IO:foreach("testfile")>
//}

//emlist[例 ブロックを指定][ruby]{
require "pathname"

IO.write("testfile...
...", "line1\nline2,\nline3\n")
P
athname("testfile").each_line {|f| p f }

# => "line1\n"
# => "line2,\n"
# => "line3\n"
//}

//emlist[例 limit を指定][ruby]{
require "pathname"

IO.write("testfile", "line1\nline2,\nline3\n")
P
athname("testfile").each_line(4) {|f| p f }

# => "line"
# => "1\n"
# =>...
..."line"
# => "2,\n"
# => "line"
# => "3\n"
//}

//emlist[例 sep を指定][ruby]{
require "pathname"

IO.write("testfile", "line1\nline2,\nline3\n")
P
athname("testfile").each_line(",") {|f| p f }

# => "line1\nline2,"
# => "\nline3\n"
//}

@see IO.foreach...

Pathname#ctime -> Time (3023.0)

File.ctime(self.to_s) を渡したものと同じです。

...File.ctime(self.to_s) を渡したものと同じです。

//emlist[例][ruby]{
require 'pathname'

IO.write("testfile", "test")
p
athname = Pathname("testfile")
p
athname.ctime # => 2019-01-14 00:39:51 +0900
sleep 1
p
athname.chmod(0755)
p
athname.ctime # => 2019-01-14 00:39:52 +0900
//}

@see File.ct...

絞り込み条件を変える

<< 1 2 > >>