Class: FeedSearcher::Page
- Inherits:
-
Object
- Object
- FeedSearcher::Page
- Defined in:
- lib/feed_searcher/page.rb
Constant Summary collapse
- EXTENSIONS =
%w[ atom rdf rss ]
- MIME_TYPES =
%w[ application/atom+xml application/rdf+xml application/rss+xml ]
Instance Attribute Summary collapse
-
#page ⇒ Object
readonly
Returns the value of attribute page.
Instance Method Summary collapse
- #feed_urls ⇒ Object
-
#initialize(page) ⇒ Page
constructor
A new instance of Page.
Constructor Details
#initialize(page) ⇒ Page
Returns a new instance of Page.
17 18 19 |
# File 'lib/feed_searcher/page.rb', line 17 def initialize(page) @page = page end |
Instance Attribute Details
#page ⇒ Object (readonly)
Returns the value of attribute page.
15 16 17 |
# File 'lib/feed_searcher/page.rb', line 15 def page @page end |
Instance Method Details
#feed_urls ⇒ Object
21 22 23 24 25 |
# File 'lib/feed_searcher/page.rb', line 21 def feed_urls urls = [] urls << url if like_xml? && parsable_as_xml? && has_feed_element? urls += links.map {|link| link["href"] } end |