class ActivityPub::Actor

Included Modules

Extended Modules

Direct Known Subclasses

Defined in:

models/activity_pub/actor.cr
models/activity_pub/actor/application.cr
models/activity_pub/actor/group.cr
models/activity_pub/actor/organization.cr
models/activity_pub/actor/person.cr
models/activity_pub/actor/service.cr
rules/content_rules.cr

Constant Summary

ATTACHMENT_LIMIT = 4

Class Method Summary

Macro Summary

Instance Method Summary

Class methods inherited from module ActivityPub

from_json_ld(json, **options) from_json_ld, from_json_ld?(json, **options) from_json_ld?

Instance methods inherited from module Ktistec::Model::Blockable

block! block!, blocked? blocked?, blocked_at : Time | Nil blocked_at, blocked_at=(blocked_at : Time | Nil) blocked_at=, unblock! unblock!

Instance methods inherited from module Ktistec::Model::Deletable

delete! delete!, deleted? deleted?, deleted_at : Time | Nil deleted_at, deleted_at=(deleted_at : Time | Nil) deleted_at=

Instance methods inherited from module Ktistec::Model::Polymorphic

as_a(as _as : T.class) : T forall T as_a, type : String type, type=(type : String) type=

Macros inherited from module Ktistec::Model::Polymorphic

find(_id id, *, as _as)
find(*, as _as, **options)
find

Instance methods inherited from module Ktistec::Model::Linked

cached? cached?, local? local?, origin origin, to_s(io : IO) to_s, uid uid

Instance methods inherited from module Ktistec::Model::Common

created_at : Time created_at, created_at=(created_at : Time) created_at=, updated_at : Time updated_at, updated_at=(updated_at : Time) updated_at=

Instance methods inherited from module Ktistec::Model::InstanceMethods

==(other) ==, _run_validations _run_validations, _save_model(skip_validation = false) _save_model, _serialize_graph(nodes, association = nil, index = nil, skip_associated = false) _serialize_graph, assign(properties : Hash(String, Any), *, _strict : Bool = false) forall Any
assign(*, _strict : Bool = false, **properties)
assign
, changed!(*properties : Symbol) changed!, changed?
changed?(*properties : Symbol)
changed?
, clear!
clear!(*properties : Symbol)
clear!
, destroy destroy, destroyed? destroyed?, errors errors, hash(hasher) hash, inspect(io : IO) inspect, new_record? new_record?, reload! reload!, save(skip_validation = false, skip_associated = false) save, serialize_graph(skip_associated = false) serialize_graph, table_name table_name, to_h to_h, to_json(json : JSON::Builder) to_json, to_s(io : IO) to_s, update_property(property, value) update_property, valid?(skip_associated = false) valid?, validate(skip_associated = false) validate

Constructor methods inherited from module Ktistec::Model::InstanceMethods

new(properties : Hash(String, Any), *, _strict : Bool = false) forall Any
new(*, _strict : Bool = false, **properties)
new

Macros inherited from module Ktistec::Model::InstanceMethods

belongs_to(name, primary_key = id, foreign_key = nil, class_name = nil, inverse_of = nil) belongs_to, derived(decl, *, aliased_to) derived, has_many(name, primary_key = id, foreign_key = nil, class_name = nil, inverse_of = nil) has_many, has_one(name, primary_key = id, foreign_key = nil, class_name = nil, inverse_of = nil) has_one, validates(property, &block) validates

Instance methods inherited from module Ktistec::Model

id : Int64 | Nil id, id=(id : Int64 | Nil) id=

Instance methods inherited from class Ktistec::KeyPair

iri iri, private_key private_key, public_key public_key

Class Method Detail

def self.attachments_from_ldjson(entry) #

[View source]
def self.dereference?(key_pair, iri, *, ignore_cached = false, include_deleted = false, **options) : self | Nil #

[View source]
def self.find(_iri iri : String | Nil, include_deleted : Bool = false, include_undone : Bool = false) #

[View source]
def self.find?(_iri iri : String | Nil, include_deleted : Bool = false, include_undone : Bool = false) #

[View source]
def self.from_json_ld(json, **options) #

[View source]
def self.from_json_ld?(json, **options) #

[View source]
def self.map(json : JSON::Any | String | IO, include_key = false, **options) #

[View source]
def self.map_icon?(json, *selector) #

[View source]
def self.match?(account) #

[View source]

Macro Detail

macro common_filters_on(first_prefix = nil, second_prefix = nil, activity_prefix = nil) #

Adds common filters to a query.

The first_prefix and second_prefix can be either actor or object table names.


[View source]

Instance Method Detail

def _association_filter_terms #

[View source]
def _association_objects #

[View source]
def _has_many_setter_for_filter_terms(filter_terms_ : Enumerable(FilterTerm), update_associations = true) : Enumerable(FilterTerm) #

[View source]
def _has_many_setter_for_objects(objects_ : Enumerable(ActivityPub::Object), update_associations = true) : Enumerable(ActivityPub::Object) #

[View source]
def all_followers(page = 1, size = 10, public = false) #

[View source]
def all_following(page = 1, size = 10, public = true) #

[View source]
def all_posts(page = 1, size = 10) #

Returns an actor's own posts

Meant to be called on local (not cached) actors.

Includes private posts and replies!


[View source]
def announces(page = 1, size = 10) #

[View source]
def approve(object) #

[View source]
def attachments : Array(Attachment) | Nil #

[View source]
def attachments=(attachments : Array(Attachment) | Nil) #

[View source]
def before_validate #

[View source]
def display_link #

[View source]
def display_name #

[View source]
def down! #

[View source]
def down? #

[View source]
def down_at : Time | Nil #

[View source]
def down_at=(down_at : Time | Nil) #

[View source]
def drafts(page = 1, size = 10) #

[View source]
def filter_terms(include_deleted : Bool = false, include_undone : Bool = false) : Enumerable(FilterTerm) #

[View source]
def filter_terms=(filter_terms_ : Enumerable(FilterTerm)) : Enumerable(FilterTerm) #

[View source]
def find_activity_for(object, inclusion = nil, exclusion = nil) #

[View source]
def find_announce_for(object : Object) #

[View source]
def find_like_for(object : Object) #

[View source]
def follow(other : Actor, **options) #

[View source]
def followers : String | Nil #

[View source]
def followers=(followers : String | Nil) #

[View source]
def following : String | Nil #

[View source]
def following=(following : String | Nil) #

[View source]
def follows?(other : Actor, **options) #

[View source]
def from_json_ld(json, *, include_key = false) #

[View source]
def handle #

[View source]
def icon : String | Nil #

[View source]
def icon=(icon : String | Nil) #

[View source]
def image : String | Nil #

[View source]
def image=(image : String | Nil) #

[View source]
def in_inbox(page = 1, size = 10, public = true) #

[View source]
def in_inbox?(object : Object, inclusion = nil, exclusion = nil) #

[View source]
def in_outbox(page = 1, size = 10, public = true) #

[View source]
def in_outbox?(object : Object, inclusion = nil, exclusion = nil) #

[View source]
def inbox : String | Nil #

[View source]
def inbox=(inbox : String | Nil) #

[View source]
def iri : String #

def iri=(iri : String) #

def known_posts(page = 1, size = 10) #

Returns the actor's known posts.

Meant to be called on both local and cached actors.

Does not include private (not visible) posts.


[View source]
def likes(page = 1, size = 10) #

[View source]
def make_delete_activity #

[View source]
def name : String | Nil #

[View source]
def name=(name : String | Nil) #

[View source]
def notifications(since : Time) #

Returns the count of notifications for the actor since the given date.

See #notifications(page, size) for further details.


[View source]
def notifications(page = 1, size = 10) #

Returns notifications for the actor.

Meant to be called on local (not cached) actors.


[View source]
def objects(include_deleted : Bool = false, include_undone : Bool = false) : Enumerable(ActivityPub::Object) #

[View source]
def objects=(objects_ : Enumerable(ActivityPub::Object)) : Enumerable(ActivityPub::Object) #

[View source]
def outbox : String | Nil #

[View source]
def outbox=(outbox : String | Nil) #

[View source]
def pem_private_key : String | Nil #

[View source]
def pem_private_key=(pem_private_key : String | Nil) #

[View source]
def pem_public_key : String | Nil #

[View source]
def pem_public_key=(pem_public_key : String | Nil) #

[View source]
def private_key #

[View source]
def public_key #

[View source]
def public_posts(page = 1, size = 10) #

Returns the actor's public posts.

Meant to be called on local (not cached) actors.

Does not include private (not visible) posts and replies.


[View source]
def summary : String | Nil #

[View source]
def summary=(summary : String | Nil) #

[View source]
def terms(page = 1, size = 10) #

Returns the content filter terms for the actor.


[View source]
def timeline(since : Time, exclude_replies = false, inclusion = nil) #

Returns the count of entries in the actor's timeline since the given date.

See #timeline(inclusion, page, size) for further details.


[View source]
def timeline(exclude_replies = false, inclusion = nil, page = 1, size = 10) #

Returns entries in the actor's timeline.

Meant to be called on local (not cached) actors.

Includes private (not visible) posts and replies.

May be filtered to exclude replies (via exclude_replies).

May be filtered to include only objects with associated relationships of the specified type (via inclusion).


[View source]
def to_json_ld(recursive = true) #

[View source]
def unapprove(object) #

[View source]
def up! #

[View source]
def up? #

[View source]
def urls : Array(String) | Nil #

[View source]
def urls=(urls : Array(String) | Nil) #

[View source]
def username : String | Nil #

[View source]
def username=(username : String | Nil) #

[View source]