るりまサーチ

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

別のキーワード

  1. rss dc_date
  2. rss dc_dates
  3. rss dc_date=
  4. rss dc_title
  5. rss dc_type

ライブラリ

モジュール

キーワード

検索結果

DublinCoreModel#dc_date (18102.0)

@todo

@todo

DublinCoreModel#dc_date= (6102.0)

@todo

@todo

DublinCoreModel#dc_dates (6100.0)

@todo

@todo

rss (48.0)

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

...ple Article"
item.date = Time.parse("2004/11/1 10:10")
end
end

サンプル中の

item.date = ...



item.dc_date = ...

でも構いません.#dc_date=は#date=の単なる別名で
す.

===== さらにエントリを追加

さらに,

* http://example.com/article2.ht...
...h do |item|
items << item if item.dc_date
end
end
end
print_items(items)

あとはprint_itemsというメソッドを定義するだけです。

Item#dc_dateはTimeオブジェクトかnilを返します。引数の
itemsにはdc_dateがnilではないものしか含まれて...
...いないは
ずなので以下のようにソートできます。

def print_items(items)
items.sort do |x, y|
y.dc_date <=> x.dc_date
end.each do |item|
puts "#{item.dc_date.localtime.iso8601} : #{item.title} : #{item.description}"
end
end...