Constants
ALIASES = ["ActivityPub::Object::Audio", "ActivityPub::Object::Event", "ActivityPub::Object::Image", "ActivityPub::Object::Page", "ActivityPub::Object::Place", "ActivityPub::Object::Video"]
PROJECTION_METADATA = {
id: Int64,
iri: String,
attributed_to_iri: ::Union(String, ::Nil),
in_reply_to_iri: ::Union(String, ::Nil),
thread: ::Union(String, ::Nil),
published: ::Union(Time, ::Nil),
deleted: Bool,
blocked: Bool,
hashtags: ::Union(String, ::Nil),
mentions: ::Union(String, ::Nil),
depth: Int32,
}
PROJECTION_MINIMAL = {
id: Int64,
iri: String,
in_reply_to_iri: ::Union(String, ::Nil),
thread: ::Union(String, ::Nil),
depth: Int32,
}
Predefined thread query projection definitions.
Class methods
all_subtypes
Returns type and all concrete (non-abstract) subtypes,
including any aliases defined on the type.
Sourcecount_by_attributed_to(iri : String)
Returns the count of objects attributed to the actor.
Intended as an approximate posts count, so it deliberately skips
the visibility/deletion filtering that the exact post queries
apply.
Sourcedereference?(key_pair, iri, *, ignore_cached = false, include_deleted = false, deadline : Time::Instant | Nil = nil, **options) : self | Nil
Sourcefederated_posts(*, max_id = nil, min_id = nil, limit = 10)
Returns federated posts with cursor-based pagination.
Includes local posts. Does not include private (not visible)
posts.
Sourcefederated_posts_count
Returns the count of federated posts.
Includes local posts. Does not include private (not visible)
posts.
Sourcefind(_iri iri : String | Nil, include_deleted : Bool = false, include_undone : Bool = false)
Sourcefind?(_iri iri : String | Nil, include_deleted : Bool = false, include_undone : Bool = false)
Sourcefrom_json_ld(json, **options)
Sourcefrom_json_ld?(json, **options)
Sourcelatest_public_post
Returns an identifier associated with the latest public post.
Skips many joins and filters in the interest of speed.
It is intended for use in expiring cached results from the two
methods above. If the identifier changes, the cached results are
probably stale.
NB: The "identifier" is not necessarily the id of the latest
post!
Sourcepublic_posts(*, max_id = nil, min_id = nil, limit = 10)
Returns the site's public posts with cursor-based pagination.
Does not include private (not visible) posts and replies.
Sourcepublic_posts_count
Returns the count of the site's public posts.
Does not include private (not visible) posts and replies.
SourceInstance methods
_association_attributed_to
Source_association_in_reply_to
Source_association_quote_authorization
Source_association_translations
Source_belongs_to_setter_for_quote_authorization(quote_authorization_ : QuoteAuthorization, update_associations = true) : QuoteAuthorization
Sourceactivities(inclusion = nil, exclusion = nil)
SourceReturns true if the object is addressed to the given actor.
SourceAnalyzes thread structure and participation patterns.
Returns comprehensive analysis including statistics, key
participants, notable branches, and timeline histogram.
Sourceancestors(*, include_deleted = false, include_blocked = false)
Returns the ancestors from self up to the root.
Deleted/blocked ancestors are omitted from the result. Pass
include_deleted: true or include_blocked: true to include
those rows. special objects are always excluded.
Sourceannounces_count=(announces_count : Int64)
Sourceapproved_by?(approved_by)
Sourceattachments=(attachments :
Array(
Attachment) |
Nil)
Sourceattributed_to(key_pair, *, dereference = false, ignore_cached = false, ignore_changed = false, include_deleted = false, include_undone = false, deadline : Time::Instant | Nil, **options)
attributed_to?(key_pair, *, dereference = false, ignore_cached = false, ignore_changed = false, include_deleted = false, include_undone = false, deadline : Time::Instant | Nil = nil, **options)
attributed_to_iri=(attributed_to_iri : String | Nil)
Sourcecanonical_path=(canonical_path : Nil | String)
Sourcecontent=(content : String | Nil)
Sourcedescendants(*, include_deleted = false, include_blocked = false)
Returns the subtree rooted at self.
Deleted/blocked descendants are omitted from the result. Pass
include_deleted: true or include_blocked: true to include
those rows. special objects are always excluded.
Sourcedislikes_count=(dislikes_count : Int64)
Sourcedisplay_attachments
Returns the media to present for this object.
Sourcedisplay_date(timezone = nil)
Sourceemojis(include_deleted :
Bool = false, include_undone :
Bool = false) :
Enumerable(
Tag::Emoji)
Sourcein_reply_to(key_pair, *, dereference = false, ignore_cached = false, ignore_changed = false, include_deleted = false, include_undone = false, deadline : Time::Instant | Nil, **options)
in_reply_to?(key_pair, *, dereference = false, ignore_cached = false, ignore_changed = false, include_deleted = false, include_undone = false, deadline : Time::Instant | Nil = nil, **options)
in_reply_to_iri=(in_reply_to_iri : String | Nil)
Sourcelanguage=(language : String | Nil)
Sourcelikes_count=(likes_count : Int64)
Sourcementions(include_deleted :
Bool = false, include_undone :
Bool = false) :
Enumerable(
Tag::Mention)
Sourcename=(name : String | Nil)
Sourceoptional_properties?
Returns true if any of the object's optional properties are
set.
Sourcepreview
Returns the text to use for the preview of the object with fallback.
The method checks for text in the following order:
- Summary from translation
- Summary from the object
- Content from translation
- Content from the object
Returns the first non-blank value found, or nil.
Sourcepublished=(published : Time | Nil)
Sourcequote(key_pair, *, dereference = false, ignore_cached = false, ignore_changed = false, include_deleted = false, include_undone = false, deadline : Time::Instant | Nil, **options)
quote?(key_pair, *, dereference = false, ignore_cached = false, ignore_changed = false, include_deleted = false, include_undone = false, deadline : Time::Instant | Nil = nil, **options)
Returns true if this object's quote of quoted_object is
approved by the latter's author.
Sourcequote_authorization(include_deleted : Bool = false, include_undone : Bool = false) : QuoteAuthorization
Sourcequote_authorization(key_pair, *, dereference = false, ignore_cached = false, ignore_changed = false, include_deleted = false, include_undone = false, deadline : Time::Instant | Nil, **options)
quote_authorization=(quote_authorization_ : QuoteAuthorization) : QuoteAuthorization
Sourcequote_authorization?(include_deleted : Bool = false, include_undone : Bool = false) : QuoteAuthorization | Nil
Sourcequote_authorization?(key_pair, *, dereference = false, ignore_cached = false, ignore_changed = false, include_deleted = false, include_undone = false, deadline : Time::Instant | Nil = nil, **options)
quote_authorization_iri=(quote_authorization_iri : String | Nil)
Sourcequote_display_link
Returns the address of the quoted post in the content, for
display.
Sourcequote_iri=(quote_iri : String | Nil)
Sourcereplies(*, for_actor)
Returns all replies to this object.
Intended for presenting an object's replies to an authorized
user (one who may see all objects).
The for_actor parameter must be specified to disambiguate this
method from the replies property getter, but is not currently
used.
Sourcereplies(*, approved_by)
Returns all replies to this object which have been approved by
approved_by.
Intended for presenting an object's replies to an unauthorized
user (one who may not see all objects e.g. an anonymous user).
Sourcereplies_count=(replies_count : Int64)
Sourcereplies_iri=(replies_iri : String | Nil)
Sourceself_replies
Returns self-replies in threaded order.
Self-replies are replies to this object or its descendants that
share the same author as this object. They are returned in
thread ordered (parent before children).
The position string encodes the path through the reply tree,
ensuring correct ordering even when posts are fetched out of
order. The id distinguishes siblings when an author
self-replies multiple times to the same parent.
Sourcesensitive=(sensitive : Bool)
Sourceshort_date(timezone = nil)
Sourcesource=(source : Source | Nil)
Sourcespecial=(special : String | Nil)
Sourcesummary=(summary : String | Nil)
Sourcesupported_editors
Returns the editor types supported for this object.
Sourcethread(*, for_actor)
Returns all objects in the thread to which this object belongs.
Intended for presenting a thread to an authorized user (one who
may see all objects in a thread).
Filters out special objects (e.g. votes).
Does not filter out deleted or blocked objects. Leaves decisions
about presentation of these objects and their replies to the
caller.
The for_actor parameter must be specified to disambiguate this
method from the thread property getter, but is not currently
used.
Sourcethread(*, approved_by)
Returns all objects in the thread to which this object belongs
which have been approved by approved_by.
Filters out special objects (e.g. votes).
Does not filter out deleted or blocked objects. Leaves decisions
about presentation of these objects and their replies to the
caller.
Intended for presenting a thread to an unauthorized user (one
who may not see all objects in a thread e.g. an anonymous
user).
Sourcethread!
Updates the thread and saves the object.
On older databases, threads are lazily migrated. This is a
convenience method for triggering the update and save, and
returning the value.
Sourcethread=(thread : String | Nil)
Sourcethread_query(*, projection : T) forall T
Returns projected fields for all objects in the thread.
The projection parameter accepts a NamedTuple that defines
which fields to return. Predefined constants handle common
use-cases:
- PROJECTION_MINIMAL
- PROJECTION_METADATA
Or specify a custom projection:
projection: {id: Int64, iri: String, depth: Int32}
Returns Array(NamedTuple) with named fields.
Sourceto_json_ld(recursive = true)
Sourcetranslations(include_deleted :
Bool = false, include_undone :
Bool = false) :
Enumerable(
Translation)
Sourceupdated=(updated : Time | Nil)
Sourcevisible=(visible : Bool)
Sourcewith_replies_count!(approved_by)
Source