Module: Diaspora::Federated::Base::InstanceMethods

Defined in:
lib/diaspora/federated/base.rb

Instance Method Summary collapse

Instance Method Details

#after_dispatch(sender) ⇒ Object

Note:

this is a hook(optional)


49
50
# File 'lib/diaspora/federated/base.rb', line 49

def after_dispatch(sender)
end

#receive(user, person) ⇒ Object

This method is abstract.

43
44
45
# File 'lib/diaspora/federated/base.rb', line 43

def receive(user, person)
  raise 'You must override receive in order to enable federation on this model'
end

#subscribers(user) ⇒ Array<Person>

This method is abstract.
Note:

this must return [Array<Person>]


38
39
40
# File 'lib/diaspora/federated/base.rb', line 38

def subscribers(user)
  raise 'You must override subscribers in order to enable federation on this model'
end

#to_diaspora_xmlObject


23
24
25
26
27
28
29
# File 'lib/diaspora/federated/base.rb', line 23

def to_diaspora_xml
  "<XML>\n<post>\#{to_xml.to_s}</post>\n</XML>\n"
end

#x(input) ⇒ Object


31
32
33
# File 'lib/diaspora/federated/base.rb', line 31

def x(input)
  input.to_s.to_xs
end