ライブラリ
- English (11)
- ビルトイン (1113)
- bigdecimal (33)
-
cgi
/ html (418) -
cgi
/ util (11) - date (11)
- erb (22)
- fiddle (11)
- ipaddr (22)
- nkf (11)
- pathname (11)
- psych (22)
- rake (22)
-
rdoc
/ markup (11) -
rdoc
/ parser (11) - readline (11)
-
rexml
/ document (198) -
rubygems
/ dependency (11) -
rubygems
/ dependency _ list (11) -
rubygems
/ requirement (11) -
rubygems
/ version (11) -
shell
/ filter (18) - thread (6)
-
webrick
/ httpservlet / abstract (66) -
webrick
/ httputils (99) -
webrick
/ httpversion (11)
クラス
- Array (114)
- BasicObject (22)
- BigDecimal (33)
- Bignum (6)
- CGI (11)
- Class (11)
- Complex (5)
- Date (11)
-
Encoding
:: Converter (11) -
Enumerator
:: Lazy (33) - Exception (11)
-
Fiddle
:: Pointer (11) - Fixnum (12)
- Float (22)
-
Gem
:: Dependency (11) -
Gem
:: DependencyList (11) -
Gem
:: Requirement (11) -
Gem
:: Version (11) - Hash (90)
- IPAddr (22)
- Integer (44)
- Method (32)
- Module (104)
- Numeric (66)
- Object (77)
- Pathname (11)
-
Psych
:: Visitors :: YAMLTree (22) -
RDoc
:: Markup (11) -
RDoc
:: Parser (11) -
REXML
:: Attributes (44) -
REXML
:: CData (11) -
REXML
:: Document (22) -
REXML
:: Element (55) -
REXML
:: Elements (22) -
REXML
:: Text (11) -
REXML
:: XPath (33) -
Rake
:: EarlyTime (11) - Range (96)
- Rational (11)
-
RubyVM
:: InstructionSequence (44) -
Shell
:: Filter (18) - String (127)
- Symbol (11)
- Thread (38)
-
Thread
:: Backtrace :: Location (11) -
Thread
:: SizedQueue (33) - Time (11)
- UnboundMethod (11)
-
WEBrick
:: HTTPServlet :: AbstractServlet (66) -
WEBrick
:: HTTPUtils :: FormData (99) -
WEBrick
:: HTTPVersion (11)
モジュール
-
CGI
:: HtmlExtension (418) -
ERB
:: Util (22) - Enumerable (66)
- Kernel (11)
-
Rake
:: TaskManager (11)
オブジェクト
-
Readline
:: HISTORY (11)
キーワード
- != (11)
-
$ LAST _ PAREN _ MATCH (11) - % (11)
- << (66)
- <= (36)
- <=> (220)
- == (11)
- === (11)
- > (6)
- >> (6)
- Marshal フォーマット (11)
-
NEWS for Ruby 2
. 7 . 0 (5) - NKF (11)
- OPS (11)
- [] (11)
-
absolute
_ path (11) - add (11)
-
add
_ special (11) -
backtrace
_ locations (33) -
base
_ label (11) - bind (11)
-
bit
_ length (17) - bsearch (44)
-
bsearch
_ index (18) - cgi (11)
-
checkbox
_ group (22) -
chunk
_ while (11) -
class
_ variables (11) - compile (11)
- concat (11)
-
const
_ source _ location (5) - debug (11)
-
delete
_ if (22) - div (11)
- divmod (22)
-
do
_ DELETE (11) -
do
_ GET (11) -
do
_ HEAD (11) -
do
_ OPTIONS (11) -
do
_ POST (11) -
do
_ PUT (11) -
drop
_ while (55) - each (33)
-
each
_ attribute (11) -
each
_ data (11) -
each
_ element _ with _ attribute (11) -
each
_ element _ with _ text (11) - enq (11)
-
enum
_ for (22) -
file
_ field (22) - filename (11)
- filename= (11)
- filter (12)
- first (11)
- form (44)
-
get
_ text (11) - hidden (22)
- html (22)
-
html
_ escape (11) - img (22)
- inherited (11)
-
insert
_ output (11) - inspect (11)
-
instance
_ methods (11) - length (11)
- list (11)
- logger (11)
- match (11)
- max (22)
-
method
_ defined? (11) - methods (11)
- min (42)
- minmax (10)
- modulo (11)
-
multipart
_ form (44) - name (11)
- name= (11)
- new (33)
-
new
_ ntoh (11) - pack (19)
- pack テンプレート文字列 (11)
-
parse
_ files _ matching (11) -
password
_ field (22) - path (11)
- pretty (11)
-
private
_ method _ defined? (11) -
protected
_ method _ defined? (11) -
public
_ method _ defined? (11) - push (22)
-
radio
_ group (22) - reject (22)
- reject! (22)
- remainder (11)
-
report
_ on _ exception (8) -
report
_ on _ exception= (8) - reset (22)
-
rexml
/ parsers / ultralightparser (11) -
ruby 1
. 6 feature (11) -
ruby 1
. 8 . 2 feature (11) -
ruby 1
. 8 . 4 feature (11) -
rubygems
/ commands / environment _ command (11) -
scrolling
_ list (22) - scrub (33)
- scrub! (33)
- select (12)
- size (11)
-
slice
_ when (11) -
spec
_ predecessors (11) - split (17)
- submit (22)
-
super
_ method (10) -
synthesize
_ file _ task (11) -
take
_ while (66) -
test
/ unit (1) - text (11)
-
text
_ field (22) -
to
_ a (11) -
to
_ ary (11) -
to
_ enum (22) -
to
_ s (11) - unpack (11)
- xpath (11)
- 正規表現 (11)
検索結果
先頭5件
-
Shell
:: Filter # <(src) -> self (24106.0) -
srcをフィルタの入力とする。 srcが, 文字列ならばファイルを, IOオブジェクトであれ ばそれをそのまま入力とする。
..., IOオブジェクトであれ
ばそれをそのまま入力とする。
@param src フィルタの入力を, 文字列もしくは,IO オブジェクトで指定します。
使用例
require 'shell'
Shell.def_system_command("head")
sh = Shell.new
sh.transact {
(sh.head("-n 30") < "... -
Integer
# <(other) -> bool (21212.0) -
比較演算子。数値として小さいか判定します。
...比較演算子。数値として小さいか判定します。
@param other 比較対象の数値
@return self よりも other が大きい場合 true を返します。
そうでなければ false を返します。
//emlist[][ruby]{
1 < 1 # => false
1 < 2 # => true
//}... -
ERB
:: Util . # h(s) -> String (21207.0) -
文字列 s を HTML用にエスケープした文字列を返します。
...s を HTML用にエスケープした文字列を返します。
文字列 s 中に含まれる &"<> を、実体参照 & " < > にそれぞれ変更した文字列を返します
(CGI.escapeHTMLとほぼ同じです)。
@param s HTMLエスケープを行う文字列
//emlist[例......][ruby]{
require "erb"
include ERB::Util
puts html_escape("is a > 0 & a < 10?")
# is a > 0 & a < 10?
//}... -
BigDecimal
# <(other) -> bool (21200.0) -
self が other より小さい場合に true を、そうでない場合に false を返しま す。
...self が other より小さい場合に true を、そうでない場合に false を返しま
す。... -
Fixnum
# <(other) -> bool (21200.0) -
比較演算子。数値として小さいか判定します。
...比較演算子。数値として小さいか判定します。
@param other 比較対象の数値
@return self よりも other が大きい場合 true を返します。
そうでなければ false を返します。... -
REXML
:: Element # each _ element _ with _ attribute(key , value = nil , max = 0 , name = nil) {|element| . . . } -> () (18342.0) -
特定の属性を持つすべての子要素を引数としてブロックを呼び出します。
...ます。
maxを指定すると、対象となる子要素の先頭 max 個のみが対象となります。
name を指定すると、それは xpath 文字列と見なされ、
それにマッチするもののみが対象となります。
max に 0 を指定すると、max の指定は無視さ......h文字列
//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new("<a><b id='1'/><c id='2'/><d id='1'/><e/></a>")
doc.root.each_element_with_attribute('id'){|e| p e }
# >> <b id='1'/>
# >> <c id='2'/>
# >> <d id='1'/>
doc.root.each_element_with_attribute('id', '1'){|e| p e }
# >> <b i......d='1'/>
# >> <d id='1'/>
doc.root.each_element_with_attribute('id', '1', 1){|e| p e }
# >> <b id='1'/>
doc.root.each_element_with_attribute('id', '1', 0, 'd'){|e| p e }
# >> <d id='1'/>
//}... -
REXML
:: Element # each _ element _ with _ text(text = nil , max = 0 , name = nil) {|element| . . . } -> () (18342.0) -
テキストを子ノードとして 持つすべての子要素を引数としてブロックを呼び出します。
...ます。
maxを指定すると、対象となる子要素の先頭 max 個のみが対象となります。
name を指定すると、それは xpath 文字列と見なされ、
それにマッチするもののみが対象となります。
max に 0 を指定すると、max の指定は無視さ......me xpath文字列
//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new '<a><b>b</b><c>b</c><d>d</d><e/></a>'
doc.root.each_element_with_text {|e|p e}
# >> <b> ... </>
# >> <c> ... </>
# >> <d> ... </>
doc.root.each_element_with_text('b'){|e|p e}
# >> <b> ... </>
# >> <c> ... </>
doc.......root.each_element_with_text('b', 1){|e|p e}
# >> <b> ... </>
doc.root.each_element_with_text(nil, 0, 'd'){|e|p e}
# >> <d> ... </>
//}... -
Module
# <(other) -> bool | nil (18336.0) -
比較演算子。self が other の子孫である場合、 true を返します。 self が other の先祖か同一のクラス/モジュールである場合、false を返します。
...her の子孫である場合、 true を返します。
self が other の先祖か同一のクラス/モジュールである場合、false を返します。
継承関係にないクラス同士の比較では
nil を返します。
@param other 比較対象のモジュールやクラス
@rai......ther がクラスやモジュールではない場合に発生します。
//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 # => ni......l
p Foo < Object.new # => in `<': compared with non class/module (TypeError)
//}... -
REXML
:: Attributes # each _ attribute {|attribute| . . . } -> () (15312.0) -
各属性に対しブロックを呼び出します。
...ttribute オブジェクトで渡されます。
//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new(<<EOS)
<root xmlns:foo="http://example.org/foo"
xmlns:bar="http://example.org/bar">
<a foo:att='1' bar:att='2' att='<'/>
</root>
EOS
a = doc.get_elements("/root/a").firs......t
a.attributes.each_attribute do |attr|
p [attr.namespace, attr.name, attr.value]
end
# => ["http://example.org/foo", "att", "1"]
# => ["http://example.org/bar", "att", "2"]
# => ["", "att", "<"]
//}... -
Array
# bsearch _ index { |x| . . . } -> Integer | nil (12312.0) -
ブロックの評価結果で範囲内の各要素の判定を行い、条件を満たす値の位置を 二分探索(計算量は O(log n))で検索します。要素が見つからない場合は nil を返します。self はあらかじめソートしておく必要があります。
...素が見つからない場合は nil
を返します。self はあらかじめソートしておく必要があります。
本メソッドはArray#bsearchと同様に、ブロックを評価した結果により2
つのモードで動作します。Array#bsearch との違いは見つかった要......arch を参照してください。
//emlist[例: find-minimum モード][ruby]{
ary = [0, 4, 7, 10, 12]
ary.bsearch_index { |x| x >= 4 } # => 1
ary.bsearch_index { |x| x >= 6 } # => 2
ary.bsearch_index { |x| x >= -1 } # => 0
ary.bsearch_index { |x| x >= 100 } # => nil
//}
//emlist[例: find-......any モード][ruby]{
ary = [0, 4, 7, 10, 12]
# 4 <= v < 8 になる要素の位置を検索
ary.bsearch_index { |x| 1 - x / 4 } # => 2
# 8 <= v < 10 になる要素の位置を検索
ary.bsearch_index { |x| 4 - x / 2 } # => nil
//}
@see Array#bsearch... -
Module
# instance _ methods(inherited _ too = true) -> [Symbol] (12306.0) -
そのモジュールで定義されている public および protected メソッド名 の一覧を配列で返します。
...いる public および protected メソッド名
の一覧を配列で返します。
@param inherited_too false を指定するとそのモジュールで定義されているメソッドのみ返します。
@see Object#methods
//emlist[例1][ruby]{
class Foo
private; def private_foo() e......ed_foo() end
public; def public_foo() end
end
# あるクラスのインスタンスメソッドの一覧を得る
p Foo.instance_methods(false)
p Foo.public_instance_methods(false)
p Foo.private_instance_methods(false)
p Foo.protected_instance_methods(false)
class Bar < Foo
end
//}
実......行結果
[:protected_foo, :public_foo]
[:public_foo]
[:private_foo]
[:protected_foo]
//emlist[例2][ruby]{
class Bar
private; def private_foo() end
protected; def protected_foo() end
public; def public_foo() end
end
# あるクラスのインスタンスメソ...