Class: Guestlist::Github

Inherits:
Object
  • Object
show all
Defined in:
lib/guestlist/github.rb

Defined Under Namespace

Classes: StatusError

Class Method Summary collapse

Class Method Details

.fetch(login, token) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/guestlist/github.rb', line 8

def self.fetch(, token)
  response = HTTParty.post(
    "http://github.com/api/v2/json/user/show/#{}",
    {
      :query => {
        :login => ,
        :token => token
      }
    }
  )

  case response.code
    when 200; response
    when 401; false
    else; raise StatusError, response.code
  end
end