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