1174件ヒット
[1-100件を表示]
(0.051秒)
ライブラリ
- ビルトイン (766)
-
cgi
/ html (24) - csv (72)
- delegate (12)
- mkmf (24)
- rake (72)
-
rake
/ loaders / makefile (12) -
rdoc
/ markup (12) -
rdoc
/ parser (12) -
rexml
/ sax2listener (12) -
rexml
/ streamlistener (12) -
rubygems
/ dependency _ list (12) -
webrick
/ httpservlet / abstract (72) -
webrick
/ httputils (60)
クラス
- Array (45)
- BasicObject (60)
- CSV (72)
- Class (20)
- Exception (24)
-
Gem
:: DependencyList (12) - Hash (14)
- Method (42)
- Module (168)
- Object (120)
- Proc (55)
-
RDoc
:: Markup (12) -
RDoc
:: Parser (12) -
Rake
:: MakefileLoader (12) -
Rake
:: NameSpace (12) - Range (19)
-
RubyVM
:: InstructionSequence (48) - String (12)
-
Thread
:: Backtrace :: Location (12) - TracePoint (7)
- UnboundMethod (12)
-
WEBrick
:: HTTPServlet :: AbstractServlet (72) -
WEBrick
:: HTTPUtils :: FormData (60)
モジュール
-
CGI
:: HtmlExtension (24) - Enumerable (108)
- Kernel (36)
-
REXML
:: SAX2Listener (12) -
REXML
:: StreamListener (12) -
Rake
:: TaskManager (60)
キーワード
- ! (12)
- != (12)
- << (26)
- <= (12)
- <=> (12)
- == (12)
- === (24)
- DelegateClass (12)
- [] (48)
-
absolute
_ path (12) -
add
_ row (12) -
add
_ special (12) - ancestors (12)
-
backtrace
_ locations (12) -
base
_ label (24) - bind (12)
- call (12)
-
class
_ variables (12) -
const
_ source _ location (12) - convert (36)
- cover? (19)
-
define
_ task (12) -
do
_ DELETE (12) -
do
_ GET (12) -
do
_ HEAD (12) -
do
_ OPTIONS (12) -
do
_ POST (12) -
do
_ PUT (12) - entitydecl (12)
-
enum
_ for (24) - filename (12)
- filename= (12)
- html (24)
- include (12)
- include? (12)
- inherited (12)
- initialize (12)
- inspect (12)
-
instance
_ eval (24) -
instance
_ methods (12) -
instance
_ of? (12) -
instruction
_ sequence (7) - intern (12)
-
is
_ a? (12) -
kind
_ of? (12) - label (12)
- lazy (12)
- load (12)
- lookup (12)
- max (48)
-
method
_ defined? (12) - methods (12)
- min (48)
- name (12)
- name= (12)
- pack (21)
-
parse
_ files _ matching (12) - path (12)
-
private
_ method _ defined? (12) -
protected
_ method _ defined? (12) -
public
_ method _ defined? (12) - puts (12)
-
set
_ backtrace (12) -
spec
_ predecessors (12) -
start
_ prefix _ mapping (12) - subclasses (4)
-
super
_ method (11) - superclass (4)
-
synthesize
_ file _ task (12) -
to
_ a (12) -
to
_ ary (12) -
to
_ enum (24) -
to
_ h (14) -
to
_ s (12) -
try
_ cpp (24) -
undef
_ method (12) - unpack (12)
- yield (12)
検索結果
先頭5件
-
Module
# <(other) -> bool | nil (18173.0) -
比較演算子。self が other の子孫である場合、 true を返します。 self が other の先祖か同一のクラス/モジュールである場合、false を返します。
...す。
@param other 比較対象のモジュールやクラス
@raise TypeError other がクラスやモジュールではない場合に発生します。
//emlist[例][ruby]{
module Foo
end
class Bar
include Foo
end
class Baz < Bar
end
class Qux
end
p Bar < Foo # => true
p Baz < Bar #......=> true
p Baz < Foo # => true
p Baz < Qux # => nil
p Baz > Qux # => nil
p Foo < Object.new # => in `<': compared with non class/module (TypeError)
//}... -
Method
# <<(callable) -> Proc (6137.0) -
self と引数を合成した Proc を返します。
...呼び出しの順序が逆になります。
@param callable Proc、Method、もしくは任意の call メソッドを持ったオブジェクト。
//emlist[例][ruby]{
def f(x)
x * x
end
def g(x)
x + x
end
# (3 + 3) * (3 + 3)
p (method(:f) << method(:g)).call(3) # => 36
//}
//emlist[cal......uby]{
class WordScanner
def self.call(str)
str.scan(/\w+/)
end
end
File.write('testfile', <<~TEXT)
Hello, World!
Hello, Ruby!
TEXT
pipeline = method(:pp) << WordScanner << File.method(:read)
pipeline.call('testfile') # => ["Hello", "World", "Hello", "Ruby"]
//}
@see Proc#<<, Proc#>>... -
Module
# <=(other) -> bool | nil (6137.0) -
比較演算子。self が other の子孫であるか、self と other が 同一クラスである場合、 true を返します。 self が other の先祖である場合、false を返します。
...
@param other 比較対象のモジュールやクラス
@raise TypeError other がクラスやモジュールではない場合に発生します。
@see Module#<
//emlist[例][ruby]{
module Foo; end
module Bar
include Foo
end
module Baz
prepend Foo
end
Bar.ancestors # => [Bar, Foo]
Foo <=......Bar # => false
Bar <= Foo # => true
Baz.ancestors # => [Foo, Baz]
Foo <= Baz # => false
Baz <= Foo # => true
Foo <= Foo # => true
Foo <= Object # => nil
//}... -
Module
# <=>(other) -> Integer | nil (6137.0) -
self と other の継承関係を比較します。
...
@param other 比較対象のクラスやモジュール
//emlist[例][ruby]{
module Foo
end
class Bar
include Foo
end
class Baz < Bar
end
class Qux
end
p Bar <=> Foo # => -1
p Baz <=> Bar # => -1
p Baz <=> Foo # => -1
p Baz <=> Qux # => nil
p Qux <=> Baz # => nil
p Baz <=>... -
Proc
# <<(callable) -> Proc (6125.0) -
self と引数を合成した Proc を返します。
...は呼び出しの順序が逆になります。
@param callable Proc、Method、もしくは任意の call メソッドを持ったオブジェクト。
//emlist[例][ruby]{
f = proc { |x| x * x }
g = proc { |x| x + x }
# (3 + 3) * (3 + 3)
p (f << g).call(3) # => 36
//}
//emlist[call を定義......anner
def self.call(str)
str.scan(/\w+/)
end
end
File.write('testfile', <<~TEXT)
Hello, World!
Hello, Ruby!
TEXT
pipeline = proc { |data| puts "word count: #{data.size}" } << WordScanner << File.method(:read)
pipeline.call('testfile') # => word count: 4
//}
@see Method#<<, Method#>>... -
CSV
# <<(row) -> self (6119.0) -
自身に row を追加します。
...ん。
@param row 配列か CSV::Row のインスタンスを指定します。
CSV::Row のインスタンスが指定された場合は、CSV::Row#fields の値
のみが追加されます。
//emlist[例 配列を指定][ruby]{
require "csv"
File.write("test.csv", <<CSV)......ro", "kondo", "34"])
end
print File.read("test.csv")
# => id,first name,last name,age
# 1,taro,tanaka,20
# 2,jiro,suzuki,18
# 3,ami,sato,19
# 4,yumi,adachi,21
# 5,saburo,kondo,34
//}
//emlist[例 CSV::Row を指定][ruby]{
require "csv"
File.write("test.csv", <<CSV)
id,first name,l......CSV.open("test.csv", "a") do |csv|
row = CSV::Row.new(["id", "first name", "last name", "age"], ["5", "saburo", "kondo", "34"])
csv.add_row(row)
end
print File.read("test.csv")
# => "id", first name,last name,age
# 1,taro,tanaka,20
# 2,jiro,suzuki,18
# 3,ami,sato,19
# 4,yumi,adachi,... -
Gem
:: DependencyList # spec _ predecessors -> Hash (3023.0) -
@todo ???
...@todo ???
Return a hash of predecessors. <tt>result[spec]</tt> is an
Array of gemspecs that have a dependency satisfied by the named
spec.... -
CSV
# add _ row(row) -> self (3019.0) -
自身に row を追加します。
...ん。
@param row 配列か CSV::Row のインスタンスを指定します。
CSV::Row のインスタンスが指定された場合は、CSV::Row#fields の値
のみが追加されます。
//emlist[例 配列を指定][ruby]{
require "csv"
File.write("test.csv", <<CSV)......ro", "kondo", "34"])
end
print File.read("test.csv")
# => id,first name,last name,age
# 1,taro,tanaka,20
# 2,jiro,suzuki,18
# 3,ami,sato,19
# 4,yumi,adachi,21
# 5,saburo,kondo,34
//}
//emlist[例 CSV::Row を指定][ruby]{
require "csv"
File.write("test.csv", <<CSV)
id,first name,l......CSV.open("test.csv", "a") do |csv|
row = CSV::Row.new(["id", "first name", "last name", "age"], ["5", "saburo", "kondo", "34"])
csv.add_row(row)
end
print File.read("test.csv")
# => "id", first name,last name,age
# 1,taro,tanaka,20
# 2,jiro,suzuki,18
# 3,ami,sato,19
# 4,yumi,adachi,... -
CSV
# puts(row) -> self (3019.0) -
自身に row を追加します。
...ん。
@param row 配列か CSV::Row のインスタンスを指定します。
CSV::Row のインスタンスが指定された場合は、CSV::Row#fields の値
のみが追加されます。
//emlist[例 配列を指定][ruby]{
require "csv"
File.write("test.csv", <<CSV)......ro", "kondo", "34"])
end
print File.read("test.csv")
# => id,first name,last name,age
# 1,taro,tanaka,20
# 2,jiro,suzuki,18
# 3,ami,sato,19
# 4,yumi,adachi,21
# 5,saburo,kondo,34
//}
//emlist[例 CSV::Row を指定][ruby]{
require "csv"
File.write("test.csv", <<CSV)
id,first name,l......CSV.open("test.csv", "a") do |csv|
row = CSV::Row.new(["id", "first name", "last name", "age"], ["5", "saburo", "kondo", "34"])
csv.add_row(row)
end
print File.read("test.csv")
# => "id", first name,last name,age
# 1,taro,tanaka,20
# 2,jiro,suzuki,18
# 3,ami,sato,19
# 4,yumi,adachi,... -
Array
# pack(template) -> String (91.0) -
配列の内容を template で指定された文字列にしたがって、 バイナリとしてパックした文字列を返します。
...。
buffer が指定されていれば、バッファとして使って返値として返します。
もし template の最初にオフセット (@) が指定されていれば、
結果はオフセットの後ろから詰められます。
buffer の元の内容がオフセットより長けれ......す。
//emlist[例][ruby]{
['!'].pack('@1a', buffer: 'abc') # => "a!"
['!'].pack('@5a', buffer: 'abc') # => "abc\u0000\u0000!"
//}
@param template 自身のバイナリとしてパックするためのテンプレートを文字列で指定します。
@param buffer 結果を詰めるバッ......を扱うときには
n, N, v, V を用います。
強制的にエンディアンを指定したいときは、
リトルエンディアンなら < を、
ビッグエンディアンなら >
を後ろにつけます。! と組み合わせることも可能です。
まとめると以下のよう...