257件ヒット
[1-100件を表示]
(0.071秒)
ライブラリ
- ビルトイン (77)
- csv (22)
- optparse (22)
- ostruct (12)
- pathname (35)
- set (22)
-
shell
/ filter (12) -
webrick
/ httpresponse (22) - win32ole (33)
クラス
-
CSV
:: Row (22) - Module (33)
- OpenStruct (12)
- OptionParser (22)
- Pathname (35)
-
Shell
:: Filter (12) - Thread (22)
-
Thread
:: Backtrace :: Location (22) -
WEBrick
:: HTTPResponse (22) -
WIN32OLE
_ EVENT (11) -
WIN32OLE
_ VARIABLE (22)
モジュール
- Enumerable (22)
キーワード
-
add
_ trace _ func (11) -
content
_ length (11) -
content
_ length= (11) -
each
_ entry (13) - find (22)
- handler= (11)
- help (11)
- inspect (22)
- name (22)
-
set
_ trace _ func (11) -
to
_ csv (11) -
to
_ h (12) -
to
_ set (22)
検索結果
先頭5件
-
Shell
:: Filter # |(filter) -> object (18137.0) -
パイプ結合を filter に対して行います。
...ll.def_system_command("tail")
Shell.def_system_command("head")
Shell.def_system_command("wc")
sh = Shell.new
sh.transact {
i = 1
while i <= (cat("/etc/passwd") | wc("-l")).to_s.chomp.to_i
puts (cat("/etc/passwd") | head("-n #{i}") | tail("-n 1")).to_s
i += 1
end
}... -
Thread
:: Backtrace :: Location # to _ s -> String (18132.0) -
self が表すフレームを Kernel.#caller と同じ表現にした文字列を返し ます。
...mlist[例][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.rb:9:in `new'
# path/to/foo.rb:9:in `<main>'
//}... -
Shell
:: Filter # to _ s -> String (18120.0) -
実行結果を文字列で返します。
...実行結果を文字列で返します。
require 'shell'
Shell.def_system_command("wc")
sh = Shell.new
sh.transact {
puts (cat("/etc/passwd") | wc("-l")).to_s
}... -
Module
# to _ s -> String (15139.0) -
モジュールやクラスの名前を文字列で返します。
...lass C
end
end
p A.name #=> "A"
p A::B.name #=> "A::B"
p A::C.name #=> "A::C"
# 名前のないモジュール / クラス
p Module.new.name #=> nil
p Class.new.name #=> nil
p Module.new.to_s #=> "#<Module:0x00007f90b09112c8>"
p Class.new.to_s #=> "#<Class:0x00007fa5c40b41b0>"
//}... -
OptionParser
# to _ s -> String (15132.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]
#... -
WIN32OLE
_ VARIABLE # to _ s -> String (15120.0) -
変数名を取得します。
...変数名を取得します。
@return 変数名を文字列で返します。
tobj = WIN32OLE_TYPE.new('Microsoft Excel 14.0 Object Library', 'XlSheetType')
variables = tobj.variables
variables.each do |variable|
puts "#{variable.name}" # => xlChart, xlDialogSheet, ...
end... -
CSV
:: Row # to _ s -> String (15114.0) -
自身を CSV な文字列として返します。ヘッダは使用しません。
...自身を CSV な文字列として返します。ヘッダは使用しません。
//emlist[例][ruby]{
require "csv"
row = CSV::Row.new(["header1", "header2"], [1, 2])
row.to_csv # => "1,2\n"
row.to_csv( {col_sep: "|", row_sep: "<br>"} ) # => "1|2<br>"
//}... -
Enumerable
# to _ set(klass = Set , *args) {|o| . . . } -> Set (6226.0) -
Enumerable オブジェクトの要素から、新しい集合オブジェクトを作ります。
...ラスメソッドで互換性のあるクラスです)。
引数 args およびブロックは、集合オブジェクトを生成するための new
メソッドに渡されます。
@param klass 生成する集合クラスを指定します。
@param args 集合クラスのオブジェクト初....../emlist[][ruby]{
require 'set'
p [30, 10, 20].to_set
#=> #<Set: {30, 10, 20}>
p [30, 10, 20].to_set(SortedSet)
#=> #<SortedSet: {10, 20, 30}>
MySet = Class.new(Set)
p [30, 10, 20].to_set(MySet)
#=> #<MySet: {10, 20, 30}>
p [30, 10, 20].to_set {|num| num / 10}
#=> #<Set: {3, 1, 2}>
//}
@see Set.new......y 2.7 以前は SortedSet が定義されていました)。
引数 args およびブロックは、集合オブジェクトを生成するための new
メソッドに渡されます。
@param klass 生成する集合クラスを指定します。
@param args 集合クラスのオブジェクト......urn 生成された集合オブジェクトを返します。
//emlist[][ruby]{
require 'set'
p [30, 10, 20].to_set
#=> #<Set: {30, 10, 20}>
MySet = Class.new(Set)
p [30, 10, 20].to_set(MySet)
#=> #<MySet: {10, 20, 30}>
p [30, 10, 20].to_set {|num| num / 10}
#=> #<Set: {3, 1, 2}>
//}
@see Set.new... -
Enumerable
# to _ set(klass = Set , *args) -> Set (6126.0) -
Enumerable オブジェクトの要素から、新しい集合オブジェクトを作ります。
...ラスメソッドで互換性のあるクラスです)。
引数 args およびブロックは、集合オブジェクトを生成するための new
メソッドに渡されます。
@param klass 生成する集合クラスを指定します。
@param args 集合クラスのオブジェクト初....../emlist[][ruby]{
require 'set'
p [30, 10, 20].to_set
#=> #<Set: {30, 10, 20}>
p [30, 10, 20].to_set(SortedSet)
#=> #<SortedSet: {10, 20, 30}>
MySet = Class.new(Set)
p [30, 10, 20].to_set(MySet)
#=> #<MySet: {10, 20, 30}>
p [30, 10, 20].to_set {|num| num / 10}
#=> #<Set: {3, 1, 2}>
//}
@see Set.new......y 2.7 以前は SortedSet が定義されていました)。
引数 args およびブロックは、集合オブジェクトを生成するための new
メソッドに渡されます。
@param klass 生成する集合クラスを指定します。
@param args 集合クラスのオブジェクト......urn 生成された集合オブジェクトを返します。
//emlist[][ruby]{
require 'set'
p [30, 10, 20].to_set
#=> #<Set: {30, 10, 20}>
MySet = Class.new(Set)
p [30, 10, 20].to_set(MySet)
#=> #<MySet: {10, 20, 30}>
p [30, 10, 20].to_set {|num| num / 10}
#=> #<Set: {3, 1, 2}>
//}
@see Set.new... -
Pathname
# each _ entry {|pathname| . . . } -> nil (156.0) -
Dir.foreach(self.to_s) {|f| yield Pathname.new(f) } と同じです。
...Dir.foreach(self.to_s) {|f| yield Pathname.new(f) } と同じです。
//emlist[例][ruby]{
require "pathname"
Pathname("/usr/local").each_entry {|f| p f }
# => #<Pathname:.>
# => #<Pathname:..>
# => #<Pathname:bin>
# => #<Pathname:etc>
# => #<Pathname:include>
# => #<Pathname:lib>
# => #<Pathna......Dir.foreach(self.to_s) {|f| yield Pathname.new(f) } と同じです。
ブロックを省略した場合は Enumerator を返します。
//emlist[例][ruby]{
require "pathname"
Pathname("/usr/local").each_entry {|f| p f }
# => #<Pathname:.>
# => #<Pathname:..>
# => #<Pathname:bin>
# => #<Pathna...