88件ヒット
[1-88件を表示]
(0.032秒)
種類
- インスタンスメソッド (44)
- ライブラリ (22)
- 文書 (22)
ライブラリ
- csv (44)
クラス
- CSV (33)
-
CSV
:: FieldInfo (11)
キーワード
- rdoc (11)
- rss (11)
-
ruby 1
. 6 feature (11) -
ruby 1
. 9 feature (11)
検索結果
先頭5件
-
CSV
# convert {|field , field _ info| . . . } (18229.0) -
引数 name で指定した変換器かブロックに各フィールドを渡して文字列から別 のオブジェクトへと変換します。
...ールドを渡して文字列から別
のオブジェクトへと変換します。
引数 name を指定した場合は、組み込みの CSV::Converters を変換器
として利用するために使います。また、独自の変換器を追加することもできま
す。
ブロックパ......換器の名前を指定します。
//emlist[例 name で Converter を指定][ruby]{
require "csv"
csv = CSV.new("date1,date2\n2018-07-09,2018-07-10")
csv.convert(:date)
csv.read # => 2018-07-09 ((2458309j,0s,0n),+0s,2299161j)>, #<Date: 2018-07-10 ((2458310j,0s,0n),+0s,2299161j)>
//}
//emlist[......= CSV.new("date1,date2\n2018-07-09,2018-07-10", headers: true)
csv.convert 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... -
CSV
# convert {|field| . . . } (18229.0) -
引数 name で指定した変換器かブロックに各フィールドを渡して文字列から別 のオブジェクトへと変換します。
...ールドを渡して文字列から別
のオブジェクトへと変換します。
引数 name を指定した場合は、組み込みの CSV::Converters を変換器
として利用するために使います。また、独自の変換器を追加することもできま
す。
ブロックパ......換器の名前を指定します。
//emlist[例 name で Converter を指定][ruby]{
require "csv"
csv = CSV.new("date1,date2\n2018-07-09,2018-07-10")
csv.convert(:date)
csv.read # => 2018-07-09 ((2458309j,0s,0n),+0s,2299161j)>, #<Date: 2018-07-10 ((2458310j,0s,0n),+0s,2299161j)>
//}
//emlist[......= CSV.new("date1,date2\n2018-07-09,2018-07-10", headers: true)
csv.convert 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... -
CSV
# convert(name) (18229.0) -
引数 name で指定した変換器かブロックに各フィールドを渡して文字列から別 のオブジェクトへと変換します。
...ールドを渡して文字列から別
のオブジェクトへと変換します。
引数 name を指定した場合は、組み込みの CSV::Converters を変換器
として利用するために使います。また、独自の変換器を追加することもできま
す。
ブロックパ......換器の名前を指定します。
//emlist[例 name で Converter を指定][ruby]{
require "csv"
csv = CSV.new("date1,date2\n2018-07-09,2018-07-10")
csv.convert(:date)
csv.read # => 2018-07-09 ((2458309j,0s,0n),+0s,2299161j)>, #<Date: 2018-07-10 ((2458310j,0s,0n),+0s,2299161j)>
//}
//emlist[......= CSV.new("date1,date2\n2018-07-09,2018-07-10", headers: true)
csv.convert 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... -
CSV
:: FieldInfo # index -> Integer (18155.0) -
行内で何番目のフィールドかわかるゼロベースのインデックスを返します。
...ire '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,0s... -
rss (276.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......ample.com/index.rdf"
maker.channel.title = "Example"
maker.channel.description = "Example Site"
maker.channel.link = "http://example.com/"
maker.items.new_item do |item|
item.link = "http://example.com/article.html"
item.title = "Sample Article"
item.date = Time.pa......えて
扱うことにします。
def print_items(feed)
convert_to_rss10(feed).items.each do |item|
puts "#{item.title} : #{item.description}"
end
end
convert_to_rss10は以下のようになります。
def convert_to_rss10(feed)
feed.to_rss("1.0") do |maker|
maker... -
ruby 1
. 9 feature (72.0) -
ruby 1.9 feature ruby version 1.9.0 は開発版です。 以下にあげる機能は将来削除されたり互換性のない仕様変更がなされるかもしれません。 1.9.1 以降は安定版です。 バグ修正がメインになります。
...uby-core:07414>))
((<URL:http://www.atdot.net/~ko1/w3ml/w3ml.cgi/ruby-cvs/msg/16833>))
((<URL:http://eigenclass.org/hiki.rb?Changes+in+Ruby+1.9+update+4>))
=== 2006-05-22
: accept
((<ruby-core:7917>))
=== 2006-03-21
: MatchData#[] [compat]
名前による参照
((<ruby-dev:28446>))
==......y [new]
: ENV.index [obsolete]
((<ruby-dev:25974>))
=== 2005-03-09
: Ruby 2.0 ブロックローカル変数
((<URL:http://www.rubyist.net/~matz/20050309.html#p03>))
=== 2005-03-04
: Time.strptime [lib][new]
: ParseDate.strptime [lib][new]
time ライブラリ, parsedate ライブラ....../Maker [lib] [new]
((<Imageモジュール|URL:http://web.resource.org/rss/1.0/modules/image/>))のサポート
=== 2005-02-03
: RSS::Element#convert(value) [lib] [new]
valueのエンコーディングを変換するメソッドを公開。
valueのエンコーディングは要素の... -
rdoc (36.0)
-
RDoc は Ruby のドキュメント生成を行うためのライブラリです。rdoc という ドキュメント生成のためのコマンドも含んでいます。
...--force-update
出力済みのファイルの方が新しい場合でも全てのファイルを更新します。
1.9.2 以下では指定しなかった場合は有効になりません。1.9.2 以降は指定
しなかった場合でも有効になります。
: --no-force-update
出......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:headline] 見......ction: を title で指定したものに上書きします。
//emlist{
# :category: Utility Methods
#
# CGI escapes +text+
def convert_string text
CGI.escapeHTML text
end
//}
title を省略した場合は、:section: を指定しなかった場合と同じように... -
ruby 1
. 6 feature (30.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......ruby '-*' -v
=> ruby 1.6.7 (2002-03-01) [i586-linux]
=> ruby: invalid option -* (-h will show valid options)
: 2002-05-22 parsedate
バージョンアップ((<ruby-dev:17171>))
: 2002-05-22 -T オプション
ruby のコマンドラインオプション -T の後に空白......対して例外が発生していました。
((<ruby-bugs-ja:PR#114>))
p(-1[10000000000])
=> -:1:in `[]': bignum too big to convert into `int' (RangeError)
from -:1
ruby 1.6.5 (2001-09-19) [i586-linux]
=> ruby 1.6.5 (2001-11-01) [i586-linux]...