Class: Communicator

Inherits:
Object
  • Object
show all
Defined in:
lib/turnstyl/client/communicator.rb

Instance Method Summary collapse

Instance Method Details

#get_keys_from(person) ⇒ Object



6
7
8
9
10
11
12
13
# File 'lib/turnstyl/client/communicator.rb', line 6

def get_keys_from person
  keys = []
  response = RestClient.get "https://api.github.com/users/#{person}/keys"
  JSON.parse(response).each do |hash|
    keys << hash['key']
  end
  keys
end