2019-05-02 18:17:27 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2015-08-18 17:15:46 -04:00
|
|
|
class EmbeddableHostSerializer < ApplicationSerializer
|
|
|
|
|
2017-05-05 18:08:18 -04:00
|
|
|
TO_SERIALIZE = [:id, :host, :path_whitelist, :class_name, :category_id]
|
2015-08-18 17:15:46 -04:00
|
|
|
|
2016-08-23 14:55:52 -04:00
|
|
|
attributes *TO_SERIALIZE
|
2015-08-18 17:15:46 -04:00
|
|
|
|
2016-08-23 14:55:52 -04:00
|
|
|
TO_SERIALIZE.each do |attr|
|
2019-05-06 21:27:05 -04:00
|
|
|
define_method(attr) { object.public_send(attr) }
|
2015-08-18 17:15:46 -04:00
|
|
|
end
|
|
|
|
|
2016-08-23 14:55:52 -04:00
|
|
|
end
|