Class: FetchFollowers

Inherits:
Object
  • Object
show all
Includes:
Interactor
Defined in:
lib/fetch_followers.rb

Overview

Instance Method Summary collapse

Instance Method Details

#callObject



5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/fetch_followers.rb', line 5

def call
  client = GithubApiClient.new
  followers = client.followers(context.username)
  
  if followers.response.code == "200"
    followers = followers.parsed_response
    return context.followers = followers
  else
    context.error = followers.response.message
    context.fail!
  end
end