class Lita::TravisWebhook

Attributes

ostruct[R]
parsed_json[R]

Public Class Methods

from_string(raw_json) click to toggle source
# File lib/lita/travis_webhook.rb, line 14
def self.from_string(raw_json)
  parsed = JSON.parse(raw_json)
  new parsed
end
new(parsed_json) click to toggle source
Calls superclass method
# File lib/lita/travis_webhook.rb, line 7
def initialize(parsed_json)
  @parsed_json = parsed_json
  @ostruct = super
end

Public Instance Methods

broken?() click to toggle source
# File lib/lita/travis_webhook.rb, line 35
def broken?
  !working?
end
description() click to toggle source
# File lib/lita/travis_webhook.rb, line 19
def description
  status_message
end
keys() click to toggle source
# File lib/lita/travis_webhook.rb, line 39
def keys
  parsed_json.keys
end
notification_string() click to toggle source
# File lib/lita/travis_webhook.rb, line 27
def notification_string
  "*#{description}* [#{repo_name}] >> #{message} >> (#{compare_url})"
end
repo_name() click to toggle source
# File lib/lita/travis_webhook.rb, line 23
def repo_name
  repository.fetch 'name'
end
working?() click to toggle source
# File lib/lita/travis_webhook.rb, line 31
def working?
  %w[Pending Passed Fixed].include? status_message
end