Class: Trello::Schema::Serializer::Webhooks

Inherits:
Object
  • Object
show all
Defined in:
lib/trello/schema/serializer/webhooks.rb

Class Method Summary collapse

Class Method Details

.deserialize(webhooks, default) ⇒ Object



12
13
14
15
16
17
18
19
20
# File 'lib/trello/schema/serializer/webhooks.rb', line 12

def deserialize(webhooks, default)
  return default unless webhooks

  webhooks.map do |webhook|
    next webhook if webhook.is_a?(Trello::Webhook)

    Trello::Webhook.new(webhook)
  end
end

.serialize(webhooks) ⇒ Object



6
7
8
9
10
# File 'lib/trello/schema/serializer/webhooks.rb', line 6

def serialize(webhooks)
  webhooks ||= []

  webhooks.map(&:id)
end