5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-22 16:16:21 +00:00

feat: algunos tipos son actores

This commit is contained in:
f 2024-03-07 16:54:09 -03:00
parent a8f184ecbf
commit 66e59ee5ad
No known key found for this signature in database
17 changed files with 164 additions and 3 deletions

View file

@ -16,5 +16,13 @@ class ActivityPub
def actor
ActivityPub::Actor.find_by(uri: content['actor'])
end
def actor_type?
false
end
def object_type?
true
end
end
end

View file

@ -5,6 +5,8 @@
# Una aplicación o instancia
class ActivityPub
class Object
class Application < ActivityPub::Object; end
class Application < ActivityPub::Object
include Concerns::ActorTypeConcern
end
end
end

View file

@ -0,0 +1,10 @@
# frozen_string_literal: true
# = Audio =
#
# Representa artículos
class ActivityPub
class Object
class Audio < ActivityPub::Object; end
end
end

View file

@ -0,0 +1,27 @@
# frozen_string_literal: true
class ActivityPub
class Object
module Concerns
module ActorTypeConcern
extend ActiveSupport::Concern
included do
# El objeto referencia a une Actor
#
# @see {https://www.w3.org/TR/activitystreams-vocabulary/#actor-types}
def actor_type?
true
end
# El objeto es un objeto
#
# @see {https://www.w3.org/TR/activitystreams-vocabulary/#object-types}
def object_type?
false
end
end
end
end
end
end

View file

@ -0,0 +1,10 @@
# frozen_string_literal: true
# = Document =
#
# Representa artículos
class ActivityPub
class Object
class Document < ActivityPub::Object; end
end
end

View file

@ -0,0 +1,10 @@
# frozen_string_literal: true
# = Event =
#
# Representa artículos
class ActivityPub
class Object
class Event < ActivityPub::Object; end
end
end

View file

@ -0,0 +1,10 @@
# frozen_string_literal: true
# = Group =
class ActivityPub
class Object
class Group < ActivityPub::Object
include Concerns::ActorTypeConcern
end
end
end

View file

@ -0,0 +1,10 @@
# frozen_string_literal: true
# = Image =
#
# Representa artículos
class ActivityPub
class Object
class Image < ActivityPub::Object; end
end
end

View file

@ -5,6 +5,8 @@
# Una organización
class ActivityPub
class Object
class Organization < ActivityPub::Object; end
class Organization < ActivityPub::Object
include Concerns::ActorTypeConcern
end
end
end

View file

@ -0,0 +1,10 @@
# frozen_string_literal: true
# = Page =
#
# Representa artículos
class ActivityPub
class Object
class Page < ActivityPub::Object; end
end
end

View file

@ -5,6 +5,8 @@
# Una persona, el perfil de une actore
class ActivityPub
class Object
class Person < ActivityPub::Object; end
class Person < ActivityPub::Object
include Concerns::ActorTypeConcern
end
end
end

View file

@ -0,0 +1,10 @@
# frozen_string_literal: true
# = Place =
#
# Representa artículos
class ActivityPub
class Object
class Place < ActivityPub::Object; end
end
end

View file

@ -0,0 +1,10 @@
# frozen_string_literal: true
# = Profile =
#
# Representa artículos
class ActivityPub
class Object
class Profile < ActivityPub::Object; end
end
end

View file

@ -0,0 +1,10 @@
# frozen_string_literal: true
# = Relationship =
#
# Representa artículos
class ActivityPub
class Object
class Relationship < ActivityPub::Object; end
end
end

View file

@ -0,0 +1,10 @@
# frozen_string_literal: true
# = Service =
class ActivityPub
class Object
class Service < ActivityPub::Object
include Concerns::ActorTypeConcern
end
end
end

View file

@ -0,0 +1,10 @@
# frozen_string_literal: true
# = Tombstone =
#
# Representa artículos
class ActivityPub
class Object
class Tombstone < ActivityPub::Object; end
end
end

View file

@ -0,0 +1,10 @@
# frozen_string_literal: true
# = Video =
#
# Representa artículos
class ActivityPub
class Object
class Video < ActivityPub::Object; end
end
end