6件ヒット
[1-6件を表示]
(0.044秒)
クラス
- OptionParser (2)
-
Thread
:: Backtrace :: Location (2) -
Zlib
:: GzipWriter (2)
検索結果
先頭5件
-
Thread
:: Backtrace :: Location # to _ s -> String (63343.0) -
self が表すフレームを Kernel.#caller と同じ表現にした文字列を返し ます。
self が表すフレームを Kernel.#caller と同じ表現にした文字列を返し
ます。
//emlist[例][ruby]{
# foo.rb
class Foo
attr_accessor :locations
def initialize(skip)
@locations = caller_locations(skip)
end
end
Foo.new(0..2).locations.map do |call|
puts call.to_s
end
# => path/to/foo.rb:5:in `initialize'
# path/to/foo... -
OptionParser
# to _ s -> String (54325.0) -
サマリの文字列を返します。
サマリの文字列を返します。
//emlist[例][ruby]{
require "optparse"
options = {}
opts = OptionParser.new do |opts|
opts.banner = "Usage: example.rb [options]"
opts.on("-v", "--[no-]verbose", "Run verbosely") do |v|
options[:verbose] = v
end
end
puts opts.help
# => Usage: example.rb [options]
# -v... -
Thread
:: Backtrace :: Location # inspect -> String (9070.0) -
Thread::Backtrace::Location#to_s の結果を人間が読みやすいような文 字列に変換したオブジェクトを返します。
Thread::Backtrace::Location#to_s の結果を人間が読みやすいような文
字列に変換したオブジェクトを返します。
//emlist[例][ruby]{
# foo.rb
class Foo
attr_accessor :locations
def initialize(skip)
@locations = caller_locations(skip)
end
end
Foo.new(0..2).locations.map do |call|
puts call.inspect
end
# => "path/to/foo.rb:5:in ... -
OptionParser
# help -> String (9025.0) -
サマリの文字列を返します。
サマリの文字列を返します。
//emlist[例][ruby]{
require "optparse"
options = {}
opts = OptionParser.new do |opts|
opts.banner = "Usage: example.rb [options]"
opts.on("-v", "--[no-]verbose", "Run verbosely") do |v|
options[:verbose] = v
end
end
puts opts.help
# => Usage: example.rb [options]
# -v... -
Zlib
:: GzipWriter # write(str) -> Integer (106.0) -
自身に str を出力します。str が文字列でなけ れば to_s による文字列化を試みます。
自身に str を出力します。str が文字列でなけ
れば to_s による文字列化を試みます。
@param str 出力する文字列を指定します。文字列でない場合は to_s で文字列に変換します。
@return 実際に出力できたバイト数を返します。
require 'zlib'
filename='hoge1.gz'
fw = File.open(filename, "w")
Zlib::GzipWriter.wrap(fw, Zlib::BEST_COMPRESSION){|gz|
gz.write "foo"
}
fr = File.open... -
Zlib
:: GzipWriter # <<(str) -> self (88.0) -
str を出力します。str が文字列でない場合は to_s を用いて 文字列に変換します。
str を出力します。str が文字列でない場合は 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(filename)
Zlib::GzipReader.wrap(fr){|gz|
...