mirror of
https://github.com/manyfold3d/manyfold.git
synced 2026-10-22 19:52:18 -05:00
50 lines
623 B
Ruby
50 lines
623 B
Ruby
module ActivityPub
|
|
class BaseSerializer
|
|
PUBLIC_COLLECTION = "https://www.w3.org/ns/activitystreams#Public"
|
|
|
|
def initialize(object)
|
|
@object = object
|
|
end
|
|
|
|
def serialize
|
|
raise NotImplementedError
|
|
end
|
|
|
|
def federate?
|
|
true
|
|
end
|
|
|
|
def to
|
|
nil
|
|
end
|
|
|
|
def bto
|
|
nil
|
|
end
|
|
|
|
def cc
|
|
nil
|
|
end
|
|
|
|
def bcc
|
|
nil
|
|
end
|
|
|
|
def audience
|
|
nil
|
|
end
|
|
|
|
protected
|
|
|
|
def address_fields
|
|
{
|
|
"to" => to,
|
|
"bto" => bto,
|
|
"cc" => cc,
|
|
"bcc" => bcc,
|
|
"audience" => audience
|
|
}.compact
|
|
end
|
|
end
|
|
end
|