るりまサーチ

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

別のキーワード

  1. _builtin name
  2. resolv each_name
  3. net/imap name
  4. openssl name
  5. win32ole name

検索結果

<< 1 2 > >>

CSV#each {|row| ... } -> nil (18239.0)

各行に対してブロックを評価します。

...id,first name,last name,age
1,taro,tanaka,20
2,jiro,suzuki,18
3,ami,sato,19
4,yumi,adachi,21
CSV
csv = CSV.new(users, headers: true)
csv.each do |row|
p row
end

# => #<CSV::Row "id":"1" "first name":"taro" "last name":"tanaka" "age":"20">
# => #<CSV::Row "id":"2" "first name":"jiro" "last name":"...
...<CSV::Row "id":"3" "first name":"ami" "last name":"sato" "age":"19">
# => #<CSV::Row "id":"4" "first name":"yumi" "last name":"adachi" "age":"21">
//}

//emlist[例 CSV.new 時に :header => true を指定しない場合][ruby]{
require "csv"

users = <<CSV
id,first name,last name,age
1,taro,tanaka,...
...20
2,jiro,suzuki,18
3,ami,sato,19
4,yumi,adachi,21
CSV
csv = CSV.new(users)
csv.each do |row|
p row
end

# => ["id", "first name", "last name", "age"]
# => ["1", "taro", "tanaka", "20"]
# => ["2", "jiro", "suzuki", "18"]
# => ["3", "ami", "sato", "19"]
# => ["4", "yumi", "adachi", "21"]
//}...

REXML::Attributes#each {|name, value| ... } -> () (18238.0)

各属性の名前と値に対しブロックを呼び出します。

...各属性の名前と値に対しブロックを呼び出します。

名前には expanded_name(REXML::Namespace#exapnded_name)が
渡されます。

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

doc = REXML::Document.new(<<EOS)
<root xmlns:foo="http://example.org/foo"
xmlns:bar="http://examp...
...le.org/bar">
<a foo:att='1' bar:att='2' att='&lt;'/>
</root>
EOS
a = doc.get_elements("/root/a").first

a.attributes.each do |name, value|
p [name, value]
end

# => ["foo:att", "1"]
# => ["bar:att", "2"]
# => ["att", "<"]
//}...

REXML::Attributes#each_attribute {|attribute| ... } -> () (6119.0)

各属性に対しブロックを呼び出します。

...="http://example.org/bar">
<a foo:att='1' bar:att='2' att='&lt;'/>
</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"]
# => [...

ruby 1.6 feature (132.0)

ruby 1.6 feature ruby version 1.6 は安定版です。この版での変更はバグ修正がメイン になります。

...:EWOULDBLOCK

=> ruby 1.6.8 (2002-12-24) [i586-linux]
Errno::EAGAIN
-:2: uninitialized constant EWOULDBLOCK at Errno (NameError)

=> ruby 1.6.8 (2003-02-13) [i586-linux]
Errno::EAGAIN
Errno::EAGAIN

== 1.6.7 (2002-03-01) -> 1.6.8 (2002-12-2...
...p /a#{Regexp.quote("#")}b/x =~ "ab"

=> -:3: warning: ambiguous first argument; make sure
ruby 1.6.7 (2002-03-01) [i586-linux]
"#"
0

=> -:3: warning: ambiguous first argument; make sure
ruby 1.6.7 (2002-07-30) [i586-linux]...
...2002-03-10 メソッドの戻り値

以下のメソッドの戻り値が正しくなりました。((<ruby-bugs-ja:PR#205>))

* ((<Enumerable/each_with_index>)) が self を返すようになった(以前は nil)
* ((<Process/Process.setpgrp>)) が返す値が不定だった。
* ((<String...

rss (126.0)

RSS を扱うためのライブラリです。

...logo.png"

maker.textinput.title = "Search Example Site"
maker.textinput.description = "Search Example Site's all text"
maker.textinput.name = "keyword"
maker.textinput.link = "http://example.com/search.cgi"
end

===== XMLスタイルシートの指定

もし,

* http://exampl...
...数のフィードを扱う場合は以下のようにし、す
べてのフィードをRSS 2.0のように扱うことができます。

feeds.each do |xml|
rss20 = RSS::Parser.parse(xml).to_feed("rss2.0")
...
end

また、to_feedは以下のように書くことも出来ます。...
...(["My site", ...]など)

rss.channel.dc_titles.first.value == rss.channel.dc_title
# => true
# 厳密にはこう
first
_title = rss.channel.dc_titles.first
first
_title = first_title.value if first_title
first
_title == rss.channel.dc_title...

絞り込み条件を変える

CSV.parse(str, options = Hash.new) -> Array (90.0)

このメソッドは文字列を簡単にパースすることができます。 ブロックを与えた場合は、ブロックにそれぞれの行を渡します。 ブロックを省略した場合は、配列の配列を返します。

...pp'

s = <<EOS
id,first name,last name,age
1,taro,tanaka,20
2,jiro,suzuki,18
EOS

pp CSV.parse(s)
# => [["id", "first name", "last name", "age"],
# ["1", "taro", "tanaka", "20"],
# ["2", "jiro", "suzuki", "18"]]

CSV.parse(s, headers: true).each do |row|
p [row['first name'], row['age']]
e...
...=> ["taro", "20"]
# ["jiro", "18"]
//}

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

csv = "id|first name|last name|age\n1|taro|tanaka|20\n2|jiro|suzuki|18"
CSV.parse(csv, col_sep: '|') do |row|
p [row[1], row[2]]
end
# => ["first name", "last name"]
# => ["taro", "tanaka"]
# => ["jiro", "suzuki"]
//}...

CSV.parse(str, options = Hash.new) {|row| ... } -> nil (90.0)

このメソッドは文字列を簡単にパースすることができます。 ブロックを与えた場合は、ブロックにそれぞれの行を渡します。 ブロックを省略した場合は、配列の配列を返します。

...pp'

s = <<EOS
id,first name,last name,age
1,taro,tanaka,20
2,jiro,suzuki,18
EOS

pp CSV.parse(s)
# => [["id", "first name", "last name", "age"],
# ["1", "taro", "tanaka", "20"],
# ["2", "jiro", "suzuki", "18"]]

CSV.parse(s, headers: true).each do |row|
p [row['first name'], row['age']]
e...
...=> ["taro", "20"]
# ["jiro", "18"]
//}

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

csv = "id|first name|last name|age\n1|taro|tanaka|20\n2|jiro|suzuki|18"
CSV.parse(csv, col_sep: '|') do |row|
p [row[1], row[2]]
end
# => ["first name", "last name"]
# => ["taro", "tanaka"]
# => ["jiro", "suzuki"]
//}...

1.6.8から1.8.0への変更点(まとめ) (84.0)

1.6.8から1.8.0への変更点(まとめ) * ((<1.6.8から1.8.0への変更点(まとめ)/インタプリタの変更>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加されたクラス/モジュール>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加されたメソッド>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加された定数>)) * ((<1.6.8から1.8.0への変更点(まとめ)/拡張されたクラス/メソッド(互換性のある変更)>)) * ((<1.6.8から1.8.0への変更点(まとめ)/変更されたクラス/メソッド(互換性のない変更)>)) * ((<1.6.8から1.8.0への変更点(まとめ)/文法の変更>)) * ((<1.6.8から1.8.0への変更点(まとめ)/正規表現>)) * ((<1.6.8から1.8.0への変更点(まとめ)/Marshal>)) * ((<1.6.8から1.8.0への変更点(まとめ)/Windows 対応>)) * ((<1.6.8から1.8.0への変更点(まとめ)/廃止された(される予定の)機能>)) * ((<1.6.8から1.8.0への変更点(まとめ)/ライブラリ>)) * ((<1.6.8から1.8.0への変更点(まとめ)/拡張ライブラリAPI>)) * ((<1.6.8から1.8.0への変更点(まとめ)/バグ修正>)) * ((<1.6.8から1.8.0への変更点(まとめ)/サポートプラットフォームの追加>))

...なりました。
((<ruby-core:00927>))


: ((<NameError>)) & ((<NoMethodError>)) [change]

Name
Error を StandardError のサブクラスに戻しました。
クラス階層は以下のようになりました。

NoMethodError < NameError < StandardError.

: ((<Interrupt>))...
...た。

: ((<String#insert|String/insert>)) [new]

追加

(({str[n, 0] = other})) と同じ(ただし self を返す)

=== Struct

: ((<Struct/each_pair>)) [new]

追加。

=== Symbol

: ((<Symbol/Symbol.all_symbols>)) [new]
追加 ((<ruby-dev:12921>))

=== SystemCallError

: ((<Syste...
...22>))

: ((<組み込み関数/abort>)) [compat]

終了メッセージを指定できるようになりました。

=== Array

: ((<Array#first|Array/first>)) [compat]
: ((<Array#last|Array/last>)) [compat]

省略可能な引数を追加

: ((<Array#push|Array/push>)) [compat]
: ((<Array#unsh...

NEWS for Ruby 3.0.0 (66.0)

NEWS for Ruby 3.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

...d with Enumerator::ArithmeticSequence

//emlist[][ruby]{
dirty_data = ['--', 'data1', '--', 'data2', '--', 'data3']
dirty_data[(1..).step(2)] # take each second element
# => ["data1", "data2", "data3"]
//}

* Binding
* Binding#eval when called with one argument will use `"(eval)"` for `__FILE_...
...ption. 8709
* ENV
* ENV.except has been added, which returns a hash excluding the given keys and their values. 15822
* Windows: Read ENV names and values as UTF-8 encoded Strings 12650
* Encoding
* Added new encoding IBM720. 16233
* Changed default for Encoding.default_externa...
...will cause compaction to occur during major collections. At the moment, compaction adds significant overhead to major collections, so please test first! 17176
* Hash
* Hash#transform_keys and Hash#transform_keys! now accept a hash that maps keys to new keys. 16274
* Hash#except has bee...

ruby 1.8.2 feature (42.0)

ruby 1.8.2 feature ruby 1.8.2 での ruby 1.8.1 からの変更点です。

...e= [lib] [new]
: OpenSSL::X509::StoreContext#time= [lib] [new]
追加。

: OpenSSL::X509::Name::RFC2253DN [lib] [new]
module for RFC2253 DN format.

: OpenSSL::X509::Name.parse_rfc2253 [lib] [new]
new method to parse RFC2253 DN format.

=== 2004-12-18

: Object#id [ruby]...
...なく nil を返すようになりました。また、readdir しながらブロックを呼ぶのではなく、全部を配列に貯めてから each するようになりました。((<ruby-dev:24528>))

=== 2004-10-18

: WEBrick::HTTPRequest [lib] [new]
new methods. accept, accept_charset, a...
...正しました。
((<ruby-dev:22815>)) ((<ruby-dev:22819>))

=== 2004-02-06
: PrettyPrint#first? [lib] [obsolete]

=== 2004-02-05
: PrettyPrint#seplist [lib] [new]

=== 2004-01-29
: OpenSSL::X509::Name#add_entry [lib] [new]

=== 2004-01-26
: Regexp.new [ruby] [obsolete]

「{,m}」表記の場...

絞り込み条件を変える

<< 1 2 > >>