るりまサーチ

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

別のキーワード

  1. _builtin <
  2. bigdecimal <
  3. module <
  4. integer <
  5. complex <

モジュール

キーワード

検索結果

<< 1 2 > >>

REXML::Element#text(path = nil) -> String | nil (18156.0)

先頭のテキスト子ノードの文字列を返します。

...EXML::Text#value も参照してください。

path を渡した場合は、その XPath 文字列で指定される
テキストノードの文字列を返します。

テキストノードがない場合には nil を返します。

@param path XPath文字列
@see REXML::Element#get_text

//em...
...list[][ruby]{
require 'rexml/document'
doc = REXML::Document.new "<p>some text <b>this is bold!</b> more text</p>"
# doc.root (<p> ... </p>) は2つのテキストノード("some text " と " more text"
# を持っているが、前者を返す
doc.root.text # => "some text "
//}...

REXML::Text#<=>(other) -> -1 | 0 | 1 (9107.0)

テキストの内容を other と比較します。

...テキストの内容を other と比較します。

@param other 比較対象(REXML::Text オブジェクトもしくは文字列)...

RDoc::Context#<=>(other) -> -1 | 0 | 1 (9101.0)

自身と other の full_name を比較した結果を返します。

自身と other の full_name を比較した結果を返します。

ソートのために使われます。

@param other 自身と比較したいオブジェクトを指定します。

REXML::Element#text=(text) (6297.0)

「先頭の」テキストノードを text で置き換えます。

...ノードを text で置き換えます。

テキストノードを1つ以上保持している場合はそのうち
最初のノードを置き換えます。

要素がテキストノードを保持していない場合は新たなテキストノードが追加されます。

text
には文字...
...ext、nil のいずれかが指定できます。
REXML::Text オブジェクトを指定した場合には、それが設定され、
文字列を指定した場合には
REXML::Text.new(text, whitespace(), nil, raw())
で生成される Text オブジェクトが設定されます。
nil を指定...
...param text 置き換え後のテキスト(文字列、REXML::Text, nil(削除))

//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new('<a><b/></a>')
doc.to_s # => "<a><b/></a>"
doc.root.text = "Foo"; doc.to_s # => "<a><b/>Foo</a>"
doc.root.text = "Bar"; doc.to_s # => "<a><b/>Bar</a>"...

REXML::Element#each_element_with_text(text = nil, max = 0, name = nil) {|element| ... } -> () (6287.0)

テキストを子ノードとして 持つすべての子要素を引数としてブロックを呼び出します。

...テキストを子ノードとして
持つすべての子要素を引数としてブロックを呼び出します。

text
を指定すると、テキストの内容が text であるもののみを対象とします。
maxを指定すると、対象となる子要素の先頭 max 個のみが対...
...aram text テキストの中身(文字列)
@param max ブロック呼出の対象とする子要素の最大個数
@param name 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> ... </>
//}...

絞り込み条件を変える

REXML::Element#get_text(path = nil) -> REXML::Text | nil (6257.0)

先頭のテキスト子ノードを返します。

...REXML::Text#value も参照してください。

path を渡した場合は、その XPath 文字列で指定される
テキストノードの文字列を返します。

テキストノードがない場合には nil を返します。

@param path XPath文字列
@see REXML::Element#text

//emli...
...st[][ruby]{
require 'rexml/document'
doc = REXML::Document.new "<p>some text <b>this is bold!</b> more text</p>"
# doc.root (<p> ... </p>) は2つのテキストノード("some text " と " more text"
# を持っているが、前者を返す
doc.root.get_text.value # => "some text "
//}...

CGI::HtmlExtension#text_field(name = "", value = nil, size = 40, maxlength = nil) -> String (6195.0)

タイプが text である input 要素を生成します。

... text である input 要素を生成します。

@param name name 属性の値を指定します。

@param value 属性の値を指定します。

@param size size 属性の値を指定します。

@param maxlength maxlength 属性の値を指定します。

例:
text
_field("name")
# <IN...
...TYPE="text" NAME="name" SIZE="40">

text
_field("name", "value")
# <INPUT TYPE="text" NAME="name" VALUE="value" SIZE="40">

text
_field("name", "value", 80)
# <INPUT TYPE="text" NAME="name" VALUE="value" SIZE="80">

text
_field("name", "value", 80, 200)
# <INPUT TYPE="text" NAME...

CGI::HtmlExtension#text_field(attributes) -> String (6150.0)

タイプが text である input 要素を生成します。

...タイプが text である input 要素を生成します。

@param attributes 属性をハッシュで指定します。

text
_field({ "NAME" => "name", "VALUE" => "value" })
# <INPUT TYPE="text" NAME="name" VALUE="value">...

Method#<<(callable) -> Proc (6113.0)

self と引数を合成した Proc を返します。

...thod(:f) << method(:g)).call(3) # => 36
//}

//emlist[call を定義したオブジェクトを渡す例][ruby]{
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.me...
...thod(:read)
pipeline.call('testfile') # => ["Hello", "World", "Hello", "Ruby"]
//}

@see Proc#<<, Proc#>>...

Proc#<<(callable) -> Proc (6113.0)

self と引数を合成した Proc を返します。

...(f << g).call(3) # => 36
//}

//emlist[call を定義したオブジェクトを渡す例][ruby]{
class WordScanner
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}" } << W...
...ordScanner << File.method(:read)
pipeline.call('testfile') # => word count: 4
//}

@see Method#<<, Method#>>...

絞り込み条件を変える

<< 1 2 > >>