class

Feed::Backend

Inherits Reference < Object

Base class for feed judges.

The interface between a feed and whatever decides membership: a backend is given a feed's config and a batch of posts and returns a per-post verdict -- {included, reason} -- with order and identity preserved.

Constructors

register(name : String, backend : Backend) : Backend

Registers a backend.

Source

Class methods

find?(name : String) : Backend | Nil

Returns the backend.

Source

Instance methods

judge(feed : Feed, objects : Array(ActivityPub::Object)) : Array(Judgment)

Judges a batch of objects for a feed.

Returns one Judgment per object, in the same order.

Source
judging_params(params : Hash(String, JSON::Any)) : Hash(String, JSON::Any)

Returns a feed's params reduced to what decides membership.

In canonical form. Compared, never stored.

Source
validate_params(params : Hash(String, JSON::Any)) : Array(String)

Validates a feed's backend-owned params.

Returns error messages -- empty if the params are valid. Each message should be a complete sentence and is rendered verbatim.

Source

Nested types