Class: FeedSearcher::Page

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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

#pageObject (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_urlsObject



21
22
23
24
25
# File 'lib/feed_searcher/page.rb', line 21

def feed_urls
  urls = []
  urls << url if (has_feed_mime_type? || has_feed_extension?) && xml?
  urls += links.map {|link| link["href"] }
end