Updated a few comments.
Renamed generator to follow *_FEED_GENERATOR naming. Renamed feed entry as feed item. Made FEED conforms to ITERABLE [FEED_ITEM] for convenience.
This commit is contained in:
@@ -9,6 +9,8 @@ class
|
||||
inherit
|
||||
FEED_HELPERS
|
||||
|
||||
ITERABLE [FEED_ITEM]
|
||||
|
||||
create
|
||||
make
|
||||
|
||||
@@ -17,7 +19,7 @@ feature {NONE} -- Initialization
|
||||
make (a_title: READABLE_STRING_GENERAL)
|
||||
do
|
||||
create title.make_from_string_general (a_title)
|
||||
create entries.make (1)
|
||||
create items.make (1)
|
||||
create links.make (1)
|
||||
end
|
||||
|
||||
@@ -42,9 +44,17 @@ feature -- Access
|
||||
links: STRING_TABLE [FEED_LINK]
|
||||
-- Url indexed by relation
|
||||
|
||||
entries: ARRAYED_LIST [FEED_ENTRY]
|
||||
items: ARRAYED_LIST [FEED_ITEM]
|
||||
-- List of feed items.
|
||||
|
||||
feature -- Access
|
||||
|
||||
new_cursor: ITERATION_CURSOR [FEED_ITEM]
|
||||
-- <Precursor>
|
||||
do
|
||||
Result := items.new_cursor
|
||||
end
|
||||
|
||||
feature -- Element change
|
||||
|
||||
set_description (a_description: detachable READABLE_STRING_GENERAL; a_description_content_type: like description_content_type)
|
||||
@@ -69,6 +79,7 @@ feature -- Element change
|
||||
end
|
||||
|
||||
set_updated_date_with_text (a_date_text: detachable READABLE_STRING_32)
|
||||
-- Set `date' from date string representation `a_date_text'.
|
||||
do
|
||||
if a_date_text = Void then
|
||||
date := Void
|
||||
@@ -77,9 +88,10 @@ feature -- Element change
|
||||
end
|
||||
end
|
||||
|
||||
add_entry (e: FEED_ENTRY)
|
||||
add_item (a_item: FEED_ITEM)
|
||||
-- Add item `a_item' to feed `items'.
|
||||
do
|
||||
entries.force (e)
|
||||
items.force (a_item)
|
||||
end
|
||||
|
||||
feature -- Visitor
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
note
|
||||
description: "Object representing author of Feed or feed entry."
|
||||
description: "[
|
||||
Author of feed or feed entry.
|
||||
- name and email information.
|
||||
]"
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
|
||||
@@ -1,10 +1,15 @@
|
||||
note
|
||||
description: "Item of feed."
|
||||
description: "[
|
||||
A feed contains a list of items.
|
||||
This FEED_ITEM interface provides
|
||||
- title, description, content, id, date, ...
|
||||
- could be compared with other item to sort by date+title.
|
||||
]"
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
class
|
||||
FEED_ENTRY
|
||||
FEED_ITEM
|
||||
|
||||
inherit
|
||||
FEED_HELPERS
|
||||
@@ -41,6 +46,7 @@ feature -- Access
|
||||
-- By default, this should be text/html.
|
||||
|
||||
content_type_or_default (dft: READABLE_STRING_8): READABLE_STRING_8
|
||||
-- Associated content type, and if none, return given value `dft'.
|
||||
do
|
||||
if attached content_type as l_type then
|
||||
Result := l_type
|
||||
@@ -166,7 +172,7 @@ feature -- Visitor
|
||||
|
||||
accept (vis: FEED_VISITOR)
|
||||
do
|
||||
vis.visit_entry (Current)
|
||||
vis.visit_item (Current)
|
||||
end
|
||||
|
||||
end
|
||||
Reference in New Issue
Block a user