Module: Federails::ActorEntity::ClassMethods
- Defined in:
- app/models/concerns/federails/actor_entity.rb
Overview
Class methods automatically included in the concern.
Instance Method Summary collapse
-
#acts_as_federails_actor(name_field:, username_field:, profile_url_method: nil, actor_type: 'Person', user_count_method: nil, auto_create_actors: true) ⇒ Object
Configures the mapping between entity and actor.
-
#after_activity_received(activity_type, object_type, method_name) ⇒ Object
Define a method that will be called after an activity has been received.
-
#after_follow_accepted(method_name) ⇒ Object
Define a method that will be called after a follow request made by the entity is accepted The accepted follow request will be passed as an argument to the method.
-
#after_followed(method_name) ⇒ Object
Define a method that will be called after the entity receives a follow request.
Instance Method Details
#acts_as_federails_actor(name_field:, username_field:, profile_url_method: nil, actor_type: 'Person', user_count_method: nil, auto_create_actors: true) ⇒ Object
Configures the mapping between entity and actor
rubocop:disable Metrics/ParameterLists
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'app/models/concerns/federails/actor_entity.rb', line 42 def acts_as_federails_actor( name_field:, username_field:, profile_url_method: nil, actor_type: 'Person', user_count_method: nil, auto_create_actors: true ) Federails::Configuration.register_actor_class( self, username_field: username_field, name_field: name_field, profile_url_method: profile_url_method, actor_type: actor_type, user_count_method: user_count_method, auto_create_actors: auto_create_actors ) end |
#after_activity_received(activity_type, object_type, method_name) ⇒ Object
Define a method that will be called after an activity has been received
92 93 94 |
# File 'app/models/concerns/federails/actor_entity.rb', line 92 def after_activity_received(activity_type, object_type, method_name) Fediverse::Inbox.register_handler(activity_type, object_type, self, method_name) end |
#after_follow_accepted(method_name) ⇒ Object
Define a method that will be called after a follow request made by the entity is accepted The accepted follow request will be passed as an argument to the method.
80 81 82 |
# File 'app/models/concerns/federails/actor_entity.rb', line 80 def after_follow_accepted(method_name) @after_follow_accepted = method_name end |
#after_followed(method_name) ⇒ Object
Define a method that will be called after the entity receives a follow request. The follow request will be passed as an argument to the method.
69 70 71 |
# File 'app/models/concerns/federails/actor_entity.rb', line 69 def after_followed(method_name) @after_followed = method_name end |