Try to get a user - return nil if they’re not found
13 14 15 16 17 18 19 20
# File 'lib/vain/github.rb', line 13 def self.get(user_name) begin response = RestClient.get("https://api.github.com/users/#{user_name}", accept: ACCEPT) User.new(JSON.parse(response)) rescue RestClient::ResourceNotFound nil end end