Class: Lita::Handlers::Octocat

Inherits:
Handler
  • Object
show all
Defined in:
lib/lita/handlers/octocat.rb

Constant Summary collapse

URL =
'https://api.github.com/octocat'

Instance Method Summary collapse

Instance Method Details

#octocat(response) ⇒ Object



10
11
12
13
14
15
16
17
18
# File 'lib/lita/handlers/octocat.rb', line 10

def octocat(response)
  http_resp = http.get(URL)

  if http_resp.status == 200
    response.reply http_resp.body
  else
    Lita.logger.warn("Github octocat api could not be reached.")
  end
end