mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-25 23:56:22 +00:00
feat: algunos tipos son actores
This commit is contained in:
parent
a8f184ecbf
commit
66e59ee5ad
17 changed files with 164 additions and 3 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
10
app/models/activity_pub/object/audio.rb
Normal file
10
app/models/activity_pub/object/audio.rb
Normal file
|
@ -0,0 +1,10 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# = Audio =
|
||||
#
|
||||
# Representa artículos
|
||||
class ActivityPub
|
||||
class Object
|
||||
class Audio < ActivityPub::Object; end
|
||||
end
|
||||
end
|
|
@ -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
|
10
app/models/activity_pub/object/document.rb
Normal file
10
app/models/activity_pub/object/document.rb
Normal file
|
@ -0,0 +1,10 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# = Document =
|
||||
#
|
||||
# Representa artículos
|
||||
class ActivityPub
|
||||
class Object
|
||||
class Document < ActivityPub::Object; end
|
||||
end
|
||||
end
|
10
app/models/activity_pub/object/event.rb
Normal file
10
app/models/activity_pub/object/event.rb
Normal file
|
@ -0,0 +1,10 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# = Event =
|
||||
#
|
||||
# Representa artículos
|
||||
class ActivityPub
|
||||
class Object
|
||||
class Event < ActivityPub::Object; end
|
||||
end
|
||||
end
|
10
app/models/activity_pub/object/group.rb
Normal file
10
app/models/activity_pub/object/group.rb
Normal file
|
@ -0,0 +1,10 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# = Group =
|
||||
class ActivityPub
|
||||
class Object
|
||||
class Group < ActivityPub::Object
|
||||
include Concerns::ActorTypeConcern
|
||||
end
|
||||
end
|
||||
end
|
10
app/models/activity_pub/object/image.rb
Normal file
10
app/models/activity_pub/object/image.rb
Normal file
|
@ -0,0 +1,10 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# = Image =
|
||||
#
|
||||
# Representa artículos
|
||||
class ActivityPub
|
||||
class Object
|
||||
class Image < ActivityPub::Object; end
|
||||
end
|
||||
end
|
|
@ -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
|
||||
|
|
10
app/models/activity_pub/object/page.rb
Normal file
10
app/models/activity_pub/object/page.rb
Normal file
|
@ -0,0 +1,10 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# = Page =
|
||||
#
|
||||
# Representa artículos
|
||||
class ActivityPub
|
||||
class Object
|
||||
class Page < ActivityPub::Object; end
|
||||
end
|
||||
end
|
|
@ -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
|
||||
|
|
10
app/models/activity_pub/object/place.rb
Normal file
10
app/models/activity_pub/object/place.rb
Normal file
|
@ -0,0 +1,10 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# = Place =
|
||||
#
|
||||
# Representa artículos
|
||||
class ActivityPub
|
||||
class Object
|
||||
class Place < ActivityPub::Object; end
|
||||
end
|
||||
end
|
10
app/models/activity_pub/object/profile.rb
Normal file
10
app/models/activity_pub/object/profile.rb
Normal file
|
@ -0,0 +1,10 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# = Profile =
|
||||
#
|
||||
# Representa artículos
|
||||
class ActivityPub
|
||||
class Object
|
||||
class Profile < ActivityPub::Object; end
|
||||
end
|
||||
end
|
10
app/models/activity_pub/object/relationship.rb
Normal file
10
app/models/activity_pub/object/relationship.rb
Normal file
|
@ -0,0 +1,10 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# = Relationship =
|
||||
#
|
||||
# Representa artículos
|
||||
class ActivityPub
|
||||
class Object
|
||||
class Relationship < ActivityPub::Object; end
|
||||
end
|
||||
end
|
10
app/models/activity_pub/object/service.rb
Normal file
10
app/models/activity_pub/object/service.rb
Normal file
|
@ -0,0 +1,10 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# = Service =
|
||||
class ActivityPub
|
||||
class Object
|
||||
class Service < ActivityPub::Object
|
||||
include Concerns::ActorTypeConcern
|
||||
end
|
||||
end
|
||||
end
|
10
app/models/activity_pub/object/tombstone.rb
Normal file
10
app/models/activity_pub/object/tombstone.rb
Normal file
|
@ -0,0 +1,10 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# = Tombstone =
|
||||
#
|
||||
# Representa artículos
|
||||
class ActivityPub
|
||||
class Object
|
||||
class Tombstone < ActivityPub::Object; end
|
||||
end
|
||||
end
|
10
app/models/activity_pub/object/video.rb
Normal file
10
app/models/activity_pub/object/video.rb
Normal file
|
@ -0,0 +1,10 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# = Video =
|
||||
#
|
||||
# Representa artículos
|
||||
class ActivityPub
|
||||
class Object
|
||||
class Video < ActivityPub::Object; end
|
||||
end
|
||||
end
|
Loading…
Reference in a new issue