struct

API::StatusID

Inherits Struct < Value < Object

Encodes and decodes API status ids.

A status id is normally an ActivityPub::Object id. A reblog wrapper, however, needs its own id distinct from the reblogged object's id, so it encodes the ActivityPub::Activity::Announce id with a reserved high bit set. The bit disambiguates the two otherwise-overlapping namespaces while keeping the id a positive, all-digit string.

Constants

REBLOG_FLAG = 1_i64 << 62

The reserved high bit marking an announce-derived (reblog) id.

Constructors

from_announce(announce : ActivityPub::Activity::Announce) : StatusID

Encodes the id of an announce (reblog) as a wrapper id distinct from the reblogged object's id.

Source
from_object(object : ActivityPub::Object) : StatusID

Encodes the id of an object.

Source

Class methods

decode(string : String) : Tuple(Symbol, Int64) | Nil

Decodes a wire id into its kind and internal id.

Returns {:announce, id} for a reblog wrapper id, {:object, id} for a plain object id, or nil if the input is malformed or out of range.

Source

Instance methods

==(other : StatusID) : Bool
Source
==(other : String) : Bool
Source
to_json(*args, **options)
Source
to_json(*args, **options, &)
Source
to_s(*args, **options)
Source
to_s(*args, **options, &)
Source