724件ヒット
[1-100件を表示]
(0.138秒)
種類
- インスタンスメソッド (428)
- 特異メソッド (193)
- モジュール関数 (55)
- 文書 (37)
- クラス (11)
ライブラリ
- ビルトイン (296)
- csv (231)
- forwardable (11)
- open3 (44)
- psych (17)
-
rexml
/ document (77) -
rubygems
/ commands / which _ command (11)
クラス
- CSV (198)
-
CSV
:: FieldInfo (11) -
CSV
:: Row (22) -
Enumerator
:: ArithmeticSequence (12) -
Enumerator
:: Lazy (22) - IO (11)
- Object (44)
-
Psych
:: Handler (11) -
REXML
:: Attributes (44) -
REXML
:: Parent (22) -
REXML
:: XPath (11) - Range (42)
-
RubyVM
:: InstructionSequence (11) - String (88)
-
Thread
:: Backtrace :: Location (33)
モジュール
- Enumerable (22)
- Forwardable (11)
- Kernel (11)
- Open3 (44)
- Psych (6)
キーワード
-
NEWS for Ruby 2
. 0 . 0 (11) -
NEWS for Ruby 3
. 0 . 0 (4) - WhichCommand (11)
- [] (33)
- alias (11)
- binwrite (11)
- caller (11)
-
chunk
_ while (11) - each (22)
-
each
_ attribute (11) -
enum
_ for (22) - fields (11)
- filter (33)
- generate (11)
- header (11)
-
header
_ convert (22) -
insert
_ after (11) -
insert
_ before (11) - instance (22)
-
instance
_ delegate (11) - label (11)
- length (11)
- lineno (11)
- min (42)
- new (11)
- open (44)
- parse (22)
- path (11)
-
pipeline
_ rw (22) -
pipeline
_ w (22) - read (11)
- readlines (11)
-
ruby 1
. 6 feature (11) -
ruby 1
. 8 . 2 feature (11) -
safe
_ load (6) - size (11)
- slice (33)
- slice! (22)
-
slice
_ when (11) -
take
_ while (22) -
to
_ a (11) -
to
_ enum (22) -
values
_ at (11)
検索結果
先頭5件
- REXML
:: XPath . first(element , path = nil , namespaces = {} , variables = {}) -> Node | nil - Enumerator
:: ArithmeticSequence # first -> Numeric | nil - Enumerator
:: ArithmeticSequence # first(n) -> [Numeric] - REXML
:: Attributes # each _ attribute {|attribute| . . . } -> () - Enumerable
# slice _ when {|elt _ before , elt _ after| bool } -> Enumerator
-
REXML
:: XPath . first(element , path = nil , namespaces = {} , variables = {}) -> Node | nil (27337.0) -
element の path で指定した XPath 文字列にマッチする最初のノードを 返します。
...element の path で指定した XPath 文字列にマッチする最初のノードを
返します。
path に相対パスを指定した場合は element からの相対位置で
マッチするノードを探します。
絶対パスを指定した場合は element が属する文書のルー......マッチするノードを探します。
path を省略すると "*" を指定したことになります。
namespace で名前空間の対応付けを指定します。
variable で XPath 内の変数に対応する値を指定できます。
XPathインジェクション攻撃を避けるた......variables 変数名とその値の対応付け
//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new(<<EOS)
<root xmlns:x='1'>
<a>
<b>b1</b>
<x:c />
<b>b2</b>
<d />
</a>
<b> b3 </b>
</root>
EOS
a = doc.root.elements[1] # => <a> ... </>
b1 = REXML::XPath.first(a... -
Enumerator
:: ArithmeticSequence # first -> Numeric | nil (27202.0) -
等差数列の最初の要素、もしくは最初の n 要素を返します。
等差数列の最初の要素、もしくは最初の n 要素を返します。
@param n 取得する要素数。 -
Enumerator
:: ArithmeticSequence # first(n) -> [Numeric] (27202.0) -
等差数列の最初の要素、もしくは最初の n 要素を返します。
等差数列の最初の要素、もしくは最初の n 要素を返します。
@param n 取得する要素数。 -
REXML
:: Attributes # each _ attribute {|attribute| . . . } -> () (15306.0) -
各属性に対しブロックを呼び出します。
...ribute オブジェクトで渡されます。
//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").first......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", "<"]
//}... -
Enumerable
# slice _ when {|elt _ before , elt _ after| bool } -> Enumerator (12254.0) -
要素を前から順にブロックで評価し、その結果によって要素をチャンクに分け た(グループ化した)要素を持つEnumerator を返します。
...を返します。eachメソッドは以下のように呼び出します。
//emlist{
enum.slice_when { |elt_before, elt_after| bool }.each { |ary| ... }
//}
to_a や map などのその他の Enumerable モジュールのメソッ
ドも有用です。
//emlist[例][ruby]{
# 1......[1,2,4,9,10,11,12,15,16,19,20,21]
b = a.slice_when {|i, j| i+1 != j }
p b.to_a # => [[1, 2], [4], [9, 10, 11, 12], [15, 16], [19, 20, 21]]
c = b.map {|a| a.length < 3 ? a : "#{a.first}-#{a.last}" }
p c # => [[1, 2], [4], "9-12", [15, 16], "19-21"]
d = c.join(",")
p d # => "1,2,4,9-12,15,16,19-21"......a = [3, 11, 14, 25, 28, 29, 29, 41, 55, 57]
p a.slice_when {|i, j| 6 < j - i }.to_a
# => [[3], [11, 14], [25, 28, 29, 29], [41], [55, 57]]
# 増加のみの部分配列ごとに分ける。
a = [0, 9, 2, 2, 3, 2, 7, 5, 9, 5]
p a.slice_when {|i, j| i > j }.to_a
# => [[0, 9], [2, 2, 3], [2, 7], [5, 9... -
Enumerable
# chunk _ while {|elt _ before , elt _ after| . . . } -> Enumerator (12242.0) -
要素を前から順にブロックで評価し、その結果によって要素をチャンクに分け た(グループ化した)要素を持つEnumerator を返します。
...返します。eachメソッドは以下のように呼び出します。
//emlist{
enum.chunk_while { |elt_before, elt_after| bool }.each { |ary| ... }
//}
to_a や map などのその他の Enumerable モジュールのメソッ
ドも有用です。
//emlist[例][ruby]{
# 1ず......[1,2,4,9,10,11,12,15,16,19,20,21]
b = a.chunk_while {|i, j| i+1 == j }
p b.to_a # => [[1, 2], [4], [9, 10, 11, 12], [15, 16], [19, 20, 21]]
c = b.map {|a| a.length < 3 ? a : "#{a.first}-#{a.last}" }
p c # => [[1, 2], [4], "9-12", [15, 16], "19-21"]
d = c.join(",")
p d # => "1,2,4,9-12,15,16,19-21"......9, 5]
p a.chunk_while {|i, j| i <= j }.to_a
# => [[0, 9], [2, 2, 3], [2, 7], [5, 9], [5]]
# 隣り合う偶数同士、奇数同士の部分配列ごとに分ける。
# (Enumerable#chunk を使って実現する事も可能)
a = [7, 5, 9, 2, 0, 7, 9, 4, 2, 0]
p a.chunk_while {|i, j| i.even? == j.... -
Enumerator
:: Lazy # take _ while -> Enumerator :: Lazy (12212.0) -
Enumerable#take_while と同じですが、配列ではなくEnumerator::Lazy を返します。
...Enumerable#take_while と同じですが、配列ではなくEnumerator::Lazy を返します。
//emlist[例][ruby]{
1.step.lazy.zip(('a'..'z').cycle).take_while { |e| e.first < 100_000 }
# => #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator: 1:step>>:zip(#<Enumerator: "a"........"z":cycle>)>:take_while>
1.step.lazy.zip(('a'..'z').cycle).take_while { |e| e.first < 100_000 }.force.last(5)
# => [[99995, "y"], [99996, "z"], [99997, "a"], [99998, "b"], [99999, "c"]]
//}
@see Enumerable#take_while... -
Enumerator
:: Lazy # take _ while {|item| . . . } -> Enumerator :: Lazy (12212.0) -
Enumerable#take_while と同じですが、配列ではなくEnumerator::Lazy を返します。
...Enumerable#take_while と同じですが、配列ではなくEnumerator::Lazy を返します。
//emlist[例][ruby]{
1.step.lazy.zip(('a'..'z').cycle).take_while { |e| e.first < 100_000 }
# => #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator: 1:step>>:zip(#<Enumerator: "a"........"z":cycle>)>:take_while>
1.step.lazy.zip(('a'..'z').cycle).take_while { |e| e.first < 100_000 }.force.last(5)
# => [[99995, "y"], [99996, "z"], [99997, "a"], [99998, "b"], [99999, "c"]]
//}
@see Enumerable#take_while... -
Gem
:: Commands :: WhichCommand (12018.0) -
指定された Gem パッケージに含まれるライブラリのパスを見つけるためのクラスです。
...けるためのクラスです。
Usage: gem which FILE [...] [options]
Options:
-a, --[no-]all show all matching files
-g, --[no-]gems-first search gems before non-gems
Common Options:
-h, --help このコマンドの......ヘルプを表示します
-V, --[no-]verbose 表示を詳細にします
-q, --quiet 静かに実行します
--config-file FILE 指定された設定ファイルを使用します
--backtrace バック......Ruby 自体のデバッグオプションを有効にします
Arguments:
FILE Gem パッケージ名を指定します
Summary:
指定された Gem パッケージのライブラリのある場所を表示します
Defaults:
--no-gems-first --no-all... -
CSV
:: FieldInfo # header -> String | nil (9206.0) -
利用可能な場合はヘッダを表す文字列を返します。
...はヘッダを表す文字列を返します。
//emlist[例][ruby]{
require 'csv'
csv = CSV.new("date1,date2\n2018-07-09,2018-07-10", headers: true)
csv.convert do |field,field_info|
p field_info.header
Date.parse(field)
end
p csv.first
# => "date1"
# => "date2"
# => #<CSV::Row "date1":#<Da...