検索結果
-
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...