thatrubylove/fantasyhub

View on GitHub
lib/fantasyhub/feed/downloader.rb

Summary

Maintainability
A
0 mins
Test Coverage
require 'open-uri'

module Fantasyhub::Feed::Downloader
  extend self

  def download(uid)
    feed_for(uid)
  end
  alias_method :call, :download

private

  def feed_for(uid)
    url = feed_url(uid)
    open(url).read
  end

  def feed_url(uid)
    "https://api.github.com/users/#{uid}/events"
  end
end