Class: Miteru::Feeds::Feed
- Inherits:
-
Object
- Object
- Miteru::Feeds::Feed
- Includes:
- Mixins::URL
- Defined in:
- lib/miteru/feeds/feed.rb
Direct Known Subclasses
Constant Summary
Constants included from Mixins::URL
Mixins::URL::IGNORE_EXTENSIONS
Instance Method Summary collapse
-
#breakdowend_urls ⇒ Array<String>
Return breakdowned URLs.
-
#entries ⇒ Array<Miteru::Entry>
Return entries.
- #source ⇒ Object
-
#urls ⇒ Array<String>
Return URLs.
Methods included from Mixins::URL
#breakdown, #invalid_extension?
Instance Method Details
#breakdowend_urls ⇒ Array<String>
Return breakdowned URLs
37 38 39 40 41 |
# File 'lib/miteru/feeds/feed.rb', line 37 def breakdowend_urls urls.select { |url| url.start_with?("http://", "https://") }.map do |url| breakdown(url, Miteru.configuration.directory_traveling?) end.flatten.uniq end |
#entries ⇒ Array<Miteru::Entry>
Return entries
26 27 28 29 30 |
# File 'lib/miteru/feeds/feed.rb', line 26 def entries breakdowend_urls.map do |url| Entry.new(url, source) end end |
#source ⇒ Object
8 9 10 |
# File 'lib/miteru/feeds/feed.rb', line 8 def source @source ||= self.class.to_s.split("::").last end |
#urls ⇒ Array<String>
Return URLs
17 18 19 |
# File 'lib/miteru/feeds/feed.rb', line 17 def urls raise NotImplementedError, "You must implement #{self.class}##{__method__}" end |