Sha256: 6a4c3fd8500f2b69d5bb08c44f1d737b6a1d552834ddbfdfde99832c552ea399

Contents?: true

Size: 394 Bytes

Versions: 4

Compression:

Stored size: 394 Bytes

Contents

require 'feedjira'

module TinyNews

  class Feed
    attr_reader :title, :stories

    def initialize title, url
      @title = title
      @feed_url = url
      
      @stories = download_stories
    end
    
    private

    def download_stories
      feed = Feedjira::Feed.fetch_and_parse( @feed_url )
      feed.entries.map do |entry|
        entry.title
      end
    end
    
  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
tinynews-1.0.3 lib/tinynews/feed.rb
tinynews-1.0.2 lib/tinynews/feed.rb
tinynews-1.0.1 lib/tinynews/feed.rb
tinynews-1.0.0 lib/tinynews/feed.rb