るりまサーチ

最速Rubyリファレンスマニュアル検索!
2320件ヒット [1-100件を表示] (0.115秒)
トップページ > クエリ:i[x] > クエリ:h[x] > クエリ:<[x]

別のキーワード

  1. _builtin to_i
  2. fiddle to_i
  3. matrix elements_to_i
  4. csv to_i
  5. matrix i

モジュール

オブジェクト

キーワード

検索結果

<< 1 2 3 ... > >>

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 中に含まれる &"<> を、実体参照 &amp; &quot; &lt; &gt; にそれぞれ変更した文字列を返します
(CGI.escapeHTMLとほぼ同じです)。

@param s HTMLエスケープを行う文字列

//emlist[例...
...][ruby]{
require "erb"
i
nclude ERB::Util

puts html_escape("is a > 0 & a < 10?")
# is a &gt; 0 &amp; a &lt; 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
i
nclude 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='&lt;'/>
<
/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

# あるクラスのインスタンスメソ...
<< 1 2 3 ... > >>