metamaps--metamaps/app/serializers/webhook_serializer.rb

10 lines
218 B
Ruby
Raw Normal View History

# frozen_string_literal: true
class WebhookSerializer < ActiveModel::Serializer
2016-12-15 00:58:10 +00:00
attributes :text, :username, :icon_url
2016-11-05 16:34:50 +00:00
attribute :channel, if: :has_channel?
def has_channel?
true if object.channel
end
end