Class: DiasporaFederation::Entities::Contact

Inherits:
DiasporaFederation::Entity show all
Defined in:
lib/diaspora_federation/entities/contact.rb

Overview

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

Constant Summary

Constants inherited from DiasporaFederation::Entity

DiasporaFederation::Entity::ENTITY_NAME_REGEX, DiasporaFederation::Entity::INVALID_XML_REGEX

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from DiasporaFederation::Entity

class_name, entity_class, entity_name, from_hash, from_json, from_xml, #initialize, #to_h, #to_json, #to_xml

Methods included from PropertiesDSL

#class_props, #default_values, #entity, #missing_props, #optional_props, #property, #resolv_aliases

Methods included from Logging

included

Constructor Details

This class inherits a constructor from DiasporaFederation::Entity

Instance Attribute Details

#authorString (readonly)

The diaspora* ID of the person who shares their profile

Returns:

  • (String)

    sender ID

See Also:



14
# File 'lib/diaspora_federation/entities/contact.rb', line 14

property :author, :string

#blockingBoolean (readonly)

Returns if the author is blocking the person.

Returns:

  • (Boolean)

    if the author is blocking the person



32
# File 'lib/diaspora_federation/entities/contact.rb', line 32

property :blocking, :boolean, optional: true, default: false

#followingBoolean (readonly)

Returns if the author is following the person.

Returns:

  • (Boolean)

    if the author is following the person



24
# File 'lib/diaspora_federation/entities/contact.rb', line 24

property :following, :boolean, default: true

#recipientString (readonly)

The diaspora* ID of the person who will be shared with

Returns:

  • (String)

    recipient ID

See Also:



20
# File 'lib/diaspora_federation/entities/contact.rb', line 20

property :recipient, :string

#sharingBoolean (readonly)

Returns if the author is sharing with the person.

Returns:

  • (Boolean)

    if the author is sharing with the person



28
# File 'lib/diaspora_federation/entities/contact.rb', line 28

property :sharing, :boolean, default: true

Instance Method Details

#to_sString

Returns string representation of this object.

Returns:

  • (String)

    string representation of this object



35
36
37
# File 'lib/diaspora_federation/entities/contact.rb', line 35

def to_s
  "Contact:#{author}:#{recipient}"
end