Class: Coderwall::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/coderwall-api/client/profile.rb,
lib/coderwall-api/client.rb

Overview

define profile methods

Constant Summary collapse

@@base_url =
"http://coderwall.com/"

Instance Method Summary collapse

Instance Method Details

#profile(username) ⇒ Object



11
12
13
14
15
16
17
18
# File 'lib/coderwall-api/client/profile.rb', line 11

def profile(username)
  begin
   hash = JSON.load(open(url_to_get(username)))
   Coderwall::Hash.new(hash)
  rescue OpenURI::HTTPError
    console.log "Invalid username: #{username}"
  end
end