Class: Miteru::Feeds::Feed

Inherits:
Object
  • Object
show all
Includes:
Mixins::URL
Defined in:
lib/miteru/feeds/feed.rb

Direct Known Subclasses

Ayashige, PhishStats, PhishingDatabase, UrlScan, UrlScanPro

Constant Summary

Constants included from Mixins::URL

Mixins::URL::IGNORE_EXTENSIONS

Instance Method Summary collapse

Methods included from Mixins::URL

#breakdown, #invalid_extension?

Instance Method Details

#breakdowend_urlsArray<String>

Return breakdowned URLs

Returns:

  • (Array<String>)

    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

#entriesArray<Miteru::Entry>

Return entries

Returns:



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

#sourceObject



8
9
10
# File 'lib/miteru/feeds/feed.rb', line 8

def source
  @source ||= self.class.to_s.split("::").last
end

#urlsArray<String>

Return URLs

Returns:

  • (Array<String>)

    URLs

Raises:

  • (NotImplementedError)


17
18
19
# File 'lib/miteru/feeds/feed.rb', line 17

def urls
  raise NotImplementedError, "You must implement #{self.class}##{__method__}"
end