Sha256: ec50bed878f20b271b3973209ba13db42dbf350e1b42e0d02fcb46a1a97c8483

Contents?: true

Size: 510 Bytes

Versions: 1

Compression:

Stored size: 510 Bytes

Contents

module FeedlyApi
  class Feed
    attr_reader :url, :subscribers, :title, :velocity, :id

    def initialize(url)
      @url = url
      @id  = "feed%2F#{CGI.escape(@url)}"
      get_info
    end

    def get_info
      json = Api.fetch(:feeds, @id)
      @subscribers = json.fetch(:subscribers) { nil }
      @title       = json.fetch(:title) { nil }
      @velocity    = json.fetch(:velocity) { nil }
    end

    def items(params = {})
      Api.fetch(:streams, @id, params).fetch(:items)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
feedly_api-0.5.0 lib/feedly_api/feed.rb