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, #find_property_for_xml_name, #missing_props, #optional_props, #property, #resolv_aliases, #xml_names

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:



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

property :author, :string

#blockingBoolean (readonly)

Returns if the author is blocking the person

Returns:

  • (Boolean)

    if the author is blocking the person



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

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



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

property :following, :boolean, default: true

#recipientString (readonly)

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

Returns:

  • (String)

    recipient ID

See Also:



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

property :recipient, :string

#sharingBoolean (readonly)

Returns if the author is sharing with the person

Returns:

  • (Boolean)

    if the author is sharing with the person



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

property :sharing, :boolean, default: true

Instance Method Details

#to_sString

Returns string representation of this object

Returns:

  • (String)

    string representation of this object



33
34
35
# File 'lib/diaspora_federation/entities/contact.rb', line 33

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