るりまサーチ

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

別のキーワード

  1. openssl t61string
  2. asn1 t61string
  3. matrix t
  4. t61string new
  5. fiddle type_size_t

検索結果

<< 1 2 3 ... > >>

Rake::FileList#ext(newext = &#39;&#39;) -> Rake::FileList (24336.0)

各要素に String#ext を適用した新しい Rake::FileList を返します。

...String#ext を適用した新しい Rake::FileList を返します。

//emlist[][ruby]{
# Rakefile での記載例とする

IO.write("test1.rb", "test")
IO.write("test2.rb", "test")

t
ask default: :test_rake_app
t
ask :test_rake_app do
file_list = FileList.new("test1.rb", "test2.rb", "test3.rb")...
...file_list.ext(".erb") # => ["test1.erb", "test2.erb", "test3.erb"]
end
//}

@see String#ext...

URI::MailTo#to_mailtext -> String (15237.0)

URI オブジェクトからメールテキスト文字列を生成します。

...:
require 'uri'
p mailto = URI.parse("mailto:ruby-list@ruby-lang.org?subject=subscribe&cc=myaddr")
print mailto.to_mailtext

=> #<URI::MailTo:0x20104a0e URL:mailto:ruby-list@ruby-lang.org?subject=subscribe&cc=myaddr>
T
o: ruby-list@ruby-lang.org
Subject: subscribe
Cc: myaddr...

URI::MailTo#to_rfc822text -> String (15237.0)

URI オブジェクトからメールテキスト文字列を生成します。

...:
require 'uri'
p mailto = URI.parse("mailto:ruby-list@ruby-lang.org?subject=subscribe&cc=myaddr")
print mailto.to_mailtext

=> #<URI::MailTo:0x20104a0e URL:mailto:ruby-list@ruby-lang.org?subject=subscribe&cc=myaddr>
T
o: ruby-list@ruby-lang.org
Subject: subscribe
Cc: myaddr...

Prime::EratosthenesGenerator#next -> Integer (15207.0)

次の(擬似)素数を返します。なお、この実装においては擬似素数は真に素数です。

...いては擬似素数は真に素数です。

また内部的な列挙位置を進めます。

//emlist[例][ruby]{
require 'prime'
generator = Prime::EratosthenesGenerator.new
p generator.next #=> 2
p generator.next #=> 3
p generator.succ #=> 5
p generator.succ #=> 7
p generator.next #=> 11
//}...

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

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

... text で置き換えます。

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

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

t
ext には文字列、REXML::T...
...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/...

絞り込み条件を変える

Enumerator#next -> object (12319.0)

「次」のオブジェクトを返します。

...ます。
列挙が既に最後へ到達している場合は、
StopIteration 例外を発生します。このとき列挙状態は変化しません。
つまりもう一度 next を呼ぶと再び例外が発生します。

next メソッドによる外部列挙の状態は他のイテレータ...
...aise StopIteration 列挙状態が既に最後へ到達しているとき
@see Enumerator#rewind

//emlist[例1][ruby]{
str = "xyz"
enum = str.each_byte

str.bytesize.times do
puts enum.next
end
# => 120
# 121
# 122
//}

//emlist[例2][ruby]{
str = "xyz"
enum = str.each_byte

beg...
...uts enum.next while true
rescue StopIteration
puts "iteration reached at end"
end
# => 120
# 121
# 122
# iteration reached at end
puts enum.next
#=> 再度 StopIteration 例外が発生
//}

//emlist[例3: Kernel.#loop は StopIteration を捕捉します。][ruby]{
st...

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

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

...クを呼び出します。

t
ext を指定すると、テキストの内容が text であるもののみを対象とします。
maxを指定すると、対象となる子要素の先頭 max 個のみが対象となります。
name を指定すると、それは xpath 文字列と見なされ、...
...)。

@param 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 (12307.0)

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

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

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

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

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

//emlist[][...
...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 "
//}...

Pathname#sub_ext(replace) -> Pathname (12244.0)

拡張子を与えられた文字列で置き換えた Pathname オブジェクトを返します。

...Pathname オブジェクトを返します。

自身が拡張子を持たない場合は、与えられた文字列を拡張子として付加します。

@param replace 拡張子を文字列で指定します。

//emlist[例][ruby]{
require "pathname"

Pathname('/usr/bin/shutdown').sub_ext('.rb...
...<Pathname:/usr/bin/shutdown.rb>
Pathname('/home/user/test.txt').sub_ext('.pdf') # => #<Pathname:/home/user/test.pdf>
Pathname('/home/user/test').sub_ext('.pdf') # => #<Pathname:/home/user/test.pdf>
Pathname('/home/user/test.').sub_ext('.pdf') # => #<Pathname:/home/user/test..pdf>
Pathna...
...me('/home/user/.test').sub_ext('.pdf') # => #<Pathname:/home/user/.test.pdf>
Pathname('/home/user/test.tar.gz').sub_ext('.xz') # => #<Pathname:/home/user/test.tar.xz>
//}...
<< 1 2 3 ... > >>