るりまサーチ

最速Rubyリファレンスマニュアル検索!
66件ヒット [1-66件を表示] (0.109秒)

別のキーワード

  1. openssl p
  2. openssl p=
  3. fileutils mkdir_p
  4. matrix p
  5. dh p=

ライブラリ

クラス

モジュール

検索結果

REXML::Child#previous_sibling -> REXML::Node (12214.0)

前の隣接ノードを返します。

...前の隣接ノードを返します。

REXML::Node#previous_sibling_node の別名です。

@see REXML::Child#previous_sibling=...

REXML::Child#previous_sibling=(other) (12214.0)

other を self の前の隣接ノードとします。

...
other を挿入します。

@param other 挿入するノード

//emlist[][ruby]{
require 'rexml/document'

a = REXML::Element.new("a")
b = a.add_element("b")
c = REXML::Element.new("c")
b.next_sibling = c
d = REXML::Element.new("d")
b.previous_sibling = d

p
a.to_s # => "<a><d/><b/><c/></a>"
/...

REXML::Element#previous_element -> Element | nil (12202.0)

前の兄弟要素を返します。

前の兄弟要素を返します。

前の要素が存在しない場合は nil を返します。

REXML::Node#previous_sibling_node -> REXML::Node | nil (12202.0)

前の兄弟ノードを返します。

前の兄弟ノードを返します。

前の兄弟ノードが存在しない場合(ノードがルートである場合や、
最初のノードである場合)は nil を返します。

StringScanner#unscan -> self (37.0)

スキャンポインタを前回のマッチの前の位置に戻します。

...=> err
p
uts err
# 出力例
#=> unscan failed: previous match had failed
end
p
s.scan(/\w+/) # => "test"
s.unscan
begin
# 二回以上戻そうとしたので、例外が発生する。
s.unscan
rescue StringScanner::Error => err
p
uts err
# 出力例
#=> unscan failed: previous match...
...had failed
end
p
s.scan(/\w+/) # => "test"
p
s.scan(/\w+/) # => nil
begin
# 前回のマッチが失敗しているので、例外が発生する。
s.unscan
rescue => err
p
uts err
# 出力例
#=> unscan failed: previous match had failed
end
//}...

絞り込み条件を変える

REXML::Child#next_sibling=(other) (13.0)

other を self の次の隣接ノードとします。

...
other を挿入します。

@param other 挿入するノード

//emlist[][ruby]{
require 'rexml/document'

a = REXML::Element.new("a")
b = a.add_element("b")
c = REXML::Element.new("c")
b.next_sibling = c
d = REXML::Element.new("d")
b.previous_sibling = d

p
a.to_s # => "<a><d/><b/><c/></a>"
/...