class GrowViral::Warehouse::FetchesFollowHistory

Attributes

config[R]
uid[R]

Public Class Methods

fetch(*args) click to toggle source
# File lib/warehouse/fetches_follow_history.rb, line 4
def self.fetch(*args)
  new(*args).fetch
end
new(uid, deps) click to toggle source
# File lib/warehouse/fetches_follow_history.rb, line 9
def initialize(uid, deps)
  raise HandleNotUidError unless uid.is_a? Numeric

  @uid = uid
  @config = deps[:config]
end

Public Instance Methods

fetch() click to toggle source
# File lib/warehouse/fetches_follow_history.rb, line 16
def fetch
  response = Net::HTTP.get_response(uri)
  JSON.parse(response.body)
end
uri() click to toggle source
# File lib/warehouse/fetches_follow_history.rb, line 21
def uri
  @uri ||= URI.parse("#{config.host}/follow_history?uid=#{uid}")
end