gitlab-org--gitlab-foss/lib/gitlab/github_import/hook_formatter.rb
2016-06-06 12:07:45 -03:00

23 lines
390 B
Ruby

module Gitlab
module GithubImport
class HookFormatter
EVENTS = %w[* create delete pull_request push].freeze
attr_reader :raw
delegate :id, :name, :active, to: :raw
def initialize(raw)
@raw = raw
end
def config
raw.config.attrs
end
def valid?
(EVENTS & raw.events).any? && active
end
end
end
end