Sha256: 5195b4bac825bddf7896ebce8ce02c142fa311ef31e8e542869e65368208113b
Contents?: true
Size: 858 Bytes
Versions: 12
Compression:
Stored size: 858 Bytes
Contents
require "github/event" module Github class CommentEvent < Event attr_reader :comment, :project, :user class << self attr_accessor :type end delegate :type, to: "self.class" # https://developer.github.com/v3/activity/events/types/#commitcommentevent # https://developer.github.com/v3/activity/events/types/#issuecommentevent # https://developer.github.com/v3/activity/events/types/#pullrequestreviewcommentevent def initialize(payload) super @comment = payload.fetch "comment" comment["project"] = Project.find_by_slug payload["repository"]["name"] end def process! Rails.logger.info "\e[34m[github] Processing Comment Event (type: #{type})\e[0m" Houston.observer.fire "github:comment", comment Houston.observer.fire "github:comment:#{type}", comment end end end
Version data entries
12 entries across 12 versions & 1 rubygems