stringer-rss/stringer

View on GitHub
app/commands/fever_api/read_feeds.rb

Summary

Maintainability
A
0 mins
Test Coverage
# frozen_string_literal: true

module FeverAPI::ReadFeeds
  class << self
    def call(authorization:, **params)
      if params.key?(:feeds)
        { feeds: feeds(authorization) }
      else
        {}
      end
    end

    private

    def feeds(authorization)
      authorization.scope(FeedRepository.list).map(&:as_fever_json)
    end
  end
end