metamaps--metamaps/app/serializers/webhook_serializer.rb
2017-11-25 11:23:47 -08:00

10 lines
219 B
Ruby

# frozen_string_literal: true
class WebhookSerializer < ActiveModel::Serializer
attributes :text, :username, :icon_url
attribute :channel, if: :has_channel?
def has_channel?
true if object.channel
end
end