class DiasporaFederation::Entities::Contact

This entity represents a contact with another person. A user issues it when they start sharing/following with another user.

@see Validators::ContactValidator

Public Instance Methods

to_s() click to toggle source

@return [String] string representation of this object

# File lib/diaspora_federation/entities/contact.rb, line 35
def to_s
  "Contact:#{author}:#{recipient}"
end

Private Instance Methods

validate() click to toggle source
Calls superclass method
# File lib/diaspora_federation/entities/contact.rb, line 41
def validate
  super

  return unless (following || sharing) && blocking

  raise ValidationError,
        "flags invalid: following:#{following}/sharing:#{sharing} and blocking:#{blocking} can't both be true"
end