るりまサーチ

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

別のキーワード

  1. _builtin first
  2. array first
  3. range first
  4. matrix first_minor
  5. enumerable first

検索結果

<< 1 2 > >>

CSV::FieldInfo#index -> Integer (18113.0)

行内で何番目のフィールドかわかるゼロベースのインデックスを返します。

...equire 'csv'

csv = CSV.new("date1,date2\n2018-07-09,2018-07-10", headers: true)
csv.convert do |field,field_info|
p field_info.index
Date.parse(field)
end
p csv.first

# => 0
# => 1
# => #<CSV::Row "date1":#<Date: 2018-07-09 ((2458309j,0s,0n),+0s,2299161j)> "date2":#<Date: 2018-07-10 ((2458310j...

rss (126.0)

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

...xampleというサイトを
* http://example.com/index.rdfという名前のRSS 1.0

を生成するには以下のようにします.

require "rss"

rss = RSS::Maker.make("1.0") do |maker|
maker.channel.about = "http://example.com/index.rdf"
maker.channel.title = "Example"
make...
...ければ以下のようにします.

require "rss"

rss = RSS::Maker.make("1.0") do |maker|
maker.channel.about = "http://example.com/index.rdf"
maker.channel.title = "Example"
maker.channel.description = "Example Site"
maker.channel.link = "http://example.com/"

item = m...
...(["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...

ruby 1.6 feature (72.0)

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

...返していた
p "foo".slice!(5,10)

=> ruby 1.6.7 (2002-03-01) [i586-linux]
nil
-:2:in `slice!': index 5 out of string (IndexError)
from -:2
=> ruby 1.6.7 (2002-08-01) [i586-linux]
nil
nil

: 2002-07-05 String#spli...
...p foo["bar"] = "baz"
p foo

=> ruby 1.6.7 (2002-03-01) [i586-linux]
"baz"
"foo"
=> -:2:in `[]=': string not matched (IndexError)
from -:2
ruby 1.6.7 (2002-07-30) [i586-linux]

: 2002-06-03 sprintf()

"%d" で引数を整数にするときに、((<...
...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]...

1.6.8から1.8.0への変更点(まとめ) (30.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への変更点(まとめ)/サポートプラットフォームの追加>))

...[new]
: ((<aStruct#values_at|Struct/values_at>)) [new]

ruby 1.6 の ((<indexes|Array/indexes>)) は、values_at というメソッド
名になりました(ruby 1.7 では block なし ((<select|Array/select>)) が
index
es の代わりでしたが、こちらも使用すると警告が出ま...
...22>))

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

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

=== Array

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

省略可能な引数を追加

: ((<Array#push|Array/push>)) [compat]
: ((<Array#unsh...
...映された上で obsolete)

# str =~ arg だけは、arg が文字列のとき、
# Regexp.compile(Regexp.quote(arg)) =~ str と等価な str.index(arg) が
# 実行されます(したがって、$~ は設定されません)。

$; の指定に正規表現が許されるようになりま...

rdoc (30.0)

RDoc は Ruby のドキュメント生成を行うためのライブラリです。rdoc という ドキュメント生成のためのコマンドも含んでいます。

...specify the name of one or more output files. If multiple
files are present, the first is used as the index.

<tt>--quiet:</tt>:: do not output the names, sizes, byte counts,
index
areas, or bit ratios of units as
they are processed.

====[a:head...
...トを書くと、この出力を上書
きできます。

def fred # :yields: index, position
...
yield line, address

上のようにすると、以下の出力になります。

fred() { |index, position| ... }

====[a:escape] エスケープ

マークアップは <tt> タグ...

絞り込み条件を変える

RubyVM::InstructionSequence#to_a -> Array (24.0)

self の情報を 14 要素の配列にして返します。

...いた場合は "<compiled>"。

: #absolute_path

命令シーケンスの絶対パス。文字列から作成していた場合は nil。

: #first_lineno

命令シーケンスの 1 行目の行番号。

: type

命令シーケンスの種別。
:top、:method、:block、:class、:rescue...
...引数の個数。あるいは以下のよう
な配列。

[required_argc, [optional_arg_labels, ...],
splat_index, post_splat_argc, post_splat_index,
block_index, simple]

より詳細な情報については、vm_core.h を参照。

: catch_table

例外や制御構造のオ...

ruby 1.9 feature (24.0)

ruby 1.9 feature ruby version 1.9.0 は開発版です。 以下にあげる機能は将来削除されたり互換性のない仕様変更がなされるかもしれません。 1.9.1 以降は安定版です。 バグ修正がメインになります。

...nteger#downto [compat]
: Integer#doitems [compat]

ブロックがなければ enumerator を返す

: Enumerable#group_by [new]
: Enumerable#first [new]

追加

=== 2006-01-26

: ((<BasicSocket/BasicSocket.do_not_reverse_lookup>)) [compat]

do_not_reverse_lookup のデフォルト...
...)(7) # => 7

=== 2005-05-08

: Hash#hash [obsolete]
: Hash#eql? [obsolete]

削除

((<ruby-dev:26132>))

=== 2005-04-02

: ENV.key [new]
: ENV.index [obsolete]

((<ruby-dev:25974>))

=== 2005-03-09

: Ruby 2.0 ブロックローカル変数

((<URL:http://www.rubyist.net/~matz/20050309.html...
...$" に追加されるタイミングが load された後に変わりました。
((<ruby-list:40085>))

=== 2004-10-05

: Array#index {|x| ... } [new]
: Array#rindex {|x| ... } [new]

追加 ((<ruby-talk:113069>))

=== 2004-09-26

: Time#to_time [lib][new]
: Time#to_date [lib][new]
: Time#to_d...

CSV#convert {|field, field_info| ... } (18.0)

引数 name で指定した変換器かブロックに各フィールドを渡して文字列から別 のオブジェクトへと変換します。

...ert do |field,field_info|
p field
p field_info
Date.parse(field)
end
p csv.first

# => "2018-07-09"
# => <struct CSV::FieldInfo index=0, line=2, header="date1">
# => "2018-07-10"
# => #<struct CSV::FieldInfo index=1, line=2, header="date2">
# => #<CSV::Row "date1":#<Date: 2018-07-09 ((2458309j...

CSV#convert {|field| ... } (18.0)

引数 name で指定した変換器かブロックに各フィールドを渡して文字列から別 のオブジェクトへと変換します。

...ert do |field,field_info|
p field
p field_info
Date.parse(field)
end
p csv.first

# => "2018-07-09"
# => <struct CSV::FieldInfo index=0, line=2, header="date1">
# => "2018-07-10"
# => #<struct CSV::FieldInfo index=1, line=2, header="date2">
# => #<CSV::Row "date1":#<Date: 2018-07-09 ((2458309j...
<< 1 2 > >>