class
   ActivityPub::Collection
 
  - ActivityPub::Collection
 - Reference
 - Object
 
Included Modules
Extended Modules
Defined in:
models/activity_pub/collection.crConstant Summary
- 
        ALIASES = 
["ActivityPub::CollectionPage", "ActivityPub::OrderedCollection", "ActivityPub::OrderedCollectionPage"] 
Class Method Summary
- .dereference?(key_pair, iri, *, ignore_cached = false, include_deleted = false, **options) : self | Nil
 - .find(_iri iri : String | Nil, include_deleted : Bool = false, include_undone : Bool = false)
 - .find?(_iri iri : String | Nil, include_deleted : Bool = false, include_undone : Bool = false)
 - .from_json_ld(json, **options)
 - .from_json_ld?(json, **options)
 - .map(json, **options)
 
Instance Method Summary
- #_association_current
 - #_association_first
 - #_association_last
 - #_association_next
 - #_association_prev
 - #_belongs_to_setter_for_current(current_ : ActivityPub::Collection, update_associations = true) : ActivityPub::Collection
 - #_belongs_to_setter_for_first(first_ : ActivityPub::Collection, update_associations = true) : ActivityPub::Collection
 - #_belongs_to_setter_for_last(last_ : ActivityPub::Collection, update_associations = true) : ActivityPub::Collection
 - #_belongs_to_setter_for_next(next_ : ActivityPub::Collection, update_associations = true) : ActivityPub::Collection
 - #_belongs_to_setter_for_prev(prev_ : ActivityPub::Collection, update_associations = true) : ActivityPub::Collection
 - 
        #all_item_iris(source, maximum_depth = 10)
        
          
Traverses the collection and returns IRIs of all items.
 - #current(include_deleted : Bool = false, include_undone : Bool = false) : ActivityPub::Collection
 - #current=(current_ : ActivityPub::Collection) : ActivityPub::Collection
 - #current?(include_deleted : Bool = false, include_undone : Bool = false) : ActivityPub::Collection | Nil
 - #current?(key_pair, *, dereference = false, ignore_cached = false, ignore_changed = false, **options)
 - #current_iri : String | Nil
 - #current_iri=(current_iri : String | Nil)
 - #first(include_deleted : Bool = false, include_undone : Bool = false) : ActivityPub::Collection
 - #first=(first_ : ActivityPub::Collection) : ActivityPub::Collection
 - #first?(include_deleted : Bool = false, include_undone : Bool = false) : ActivityPub::Collection | Nil
 - #first?(key_pair, *, dereference = false, ignore_cached = false, ignore_changed = false, **options)
 - #first_iri : String | Nil
 - #first_iri=(first_iri : String | Nil)
 - #from_json_ld(json)
 - #iri : String
 - #iri=(iri : String)
 - #items : Array(ActivityPub | String) | Nil
 - #items=(items : Array(ActivityPub | String) | Nil)
 - #items_iris : Array(String) | Nil
 - #items_iris=(items_iris : Array(String) | Nil)
 - #last(include_deleted : Bool = false, include_undone : Bool = false) : ActivityPub::Collection
 - #last=(last_ : ActivityPub::Collection) : ActivityPub::Collection
 - #last?(include_deleted : Bool = false, include_undone : Bool = false) : ActivityPub::Collection | Nil
 - #last?(key_pair, *, dereference = false, ignore_cached = false, ignore_changed = false, **options)
 - #last_iri : String | Nil
 - #last_iri=(last_iri : String | Nil)
 - #next(include_deleted : Bool = false, include_undone : Bool = false) : ActivityPub::Collection
 - #next=(next_ : ActivityPub::Collection) : ActivityPub::Collection
 - #next?(include_deleted : Bool = false, include_undone : Bool = false) : ActivityPub::Collection | Nil
 - #next?(key_pair, *, dereference = false, ignore_cached = false, ignore_changed = false, **options)
 - #next_iri : String | Nil
 - #next_iri=(next_iri : String | Nil)
 - #prev(include_deleted : Bool = false, include_undone : Bool = false) : ActivityPub::Collection
 - #prev=(prev_ : ActivityPub::Collection) : ActivityPub::Collection
 - #prev?(include_deleted : Bool = false, include_undone : Bool = false) : ActivityPub::Collection | Nil
 - #prev?(key_pair, *, dereference = false, ignore_cached = false, ignore_changed = false, **options)
 - #prev_iri : String | Nil
 - #prev_iri=(prev_iri : String | Nil)
 - #to_json_ld(recursive = true)
 - #total_items : Int64 | Nil
 - #total_items=(total_items : Int64 | Nil)
 
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::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
  
  
    
      ==(other : self)==(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_changed!
clear_changed!(*properties : Symbol) clear_changed!, destroy destroy, destroyed? destroyed?, errors errors, hash(hasher) hash, id : Int64 | Nil id, id=(id : Int64 | Nil) id=, 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
  
  
    
      new(properties : Hash(String, Any), *, _strict : Bool = false) forall Anynew(*, _strict : Bool = false, **properties) new
Macros inherited from module Ktistec::Model
  
  
    
      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
    
  
    
      
      
      
      
    
      
      
      
      
    
  Class Method Detail
        
        def self.dereference?(key_pair, iri, *, ignore_cached = false, include_deleted = false, **options) : self | Nil
        #
      
      
      
        
        def self.find(_iri iri : String | Nil, include_deleted : Bool = false, include_undone : Bool = false)
        #
      
      
      
        
        def self.find?(_iri iri : String | Nil, include_deleted : Bool = false, include_undone : Bool = false)
        #
      
      
      Instance Method Detail
        
        def _belongs_to_setter_for_current(current_ : ActivityPub::Collection, update_associations = true) : ActivityPub::Collection
        #
      
      
      
        
        def _belongs_to_setter_for_first(first_ : ActivityPub::Collection, update_associations = true) : ActivityPub::Collection
        #
      
      
      
        
        def _belongs_to_setter_for_last(last_ : ActivityPub::Collection, update_associations = true) : ActivityPub::Collection
        #
      
      
      
        
        def _belongs_to_setter_for_next(next_ : ActivityPub::Collection, update_associations = true) : ActivityPub::Collection
        #
      
      
      
        
        def _belongs_to_setter_for_prev(prev_ : ActivityPub::Collection, update_associations = true) : ActivityPub::Collection
        #
      
      
      
        
        def all_item_iris(source, maximum_depth = 10)
        #
      
      
        Traverses the collection and returns IRIs of all items.
Returns nil if #items_iris, #first_iri and #last_iri are
all nil. This is how ActivityPub hashtag collections on
Mastodon are represented -- the items are retrieved via the
Mastodon API.
        
        def current(include_deleted : Bool = false, include_undone : Bool = false) : ActivityPub::Collection
        #
      
      
      
        
        def current?(include_deleted : Bool = false, include_undone : Bool = false) : ActivityPub::Collection | Nil
        #
      
      
      
        
        def current?(key_pair, *, dereference = false, ignore_cached = false, ignore_changed = false, **options)
        #
      
      
      
        
        def first(include_deleted : Bool = false, include_undone : Bool = false) : ActivityPub::Collection
        #
      
      
      
        
        def first?(include_deleted : Bool = false, include_undone : Bool = false) : ActivityPub::Collection | Nil
        #
      
      
      
        
        def first?(key_pair, *, dereference = false, ignore_cached = false, ignore_changed = false, **options)
        #
      
      
      
        
        def last?(include_deleted : Bool = false, include_undone : Bool = false) : ActivityPub::Collection | Nil
        #
      
      
      
        
        def last?(key_pair, *, dereference = false, ignore_cached = false, ignore_changed = false, **options)
        #
      
      
      
        
        def next?(include_deleted : Bool = false, include_undone : Bool = false) : ActivityPub::Collection | Nil
        #
      
      
      
        
        def next?(key_pair, *, dereference = false, ignore_cached = false, ignore_changed = false, **options)
        #
      
      
      
        
        def prev?(include_deleted : Bool = false, include_undone : Bool = false) : ActivityPub::Collection | Nil
        #
      
      
      
        
        def prev?(key_pair, *, dereference = false, ignore_cached = false, ignore_changed = false, **options)
        #