2016-11-01 01:46:44 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
class WebhookSerializer < ActiveModel::Serializer
|
|
|
|
attributes :text, :username, :icon_url # , :attachments
|
2016-11-05 16:34:50 +00:00
|
|
|
attribute :channel, if: :has_channel?
|
|
|
|
|
|
|
|
def has_channel?
|
|
|
|
true if object.channel
|
|
|
|
end
|
2016-11-01 01:46:44 +00:00
|
|
|
end
|