Class: DiasporaFederation::Entities::AccountMigration
- Inherits:
-
DiasporaFederation::Entity
- Object
- DiasporaFederation::Entity
- DiasporaFederation::Entities::AccountMigration
- Includes:
- Signable
- Defined in:
- lib/diaspora_federation/entities/account_migration.rb
Overview
This entity is sent when a person changes their diaspora* ID (e.g. when a user migration from one to another pod happens).
Defined Under Namespace
Classes: NewPrivateKeyNotFound
Constant Summary
Constants included from Signable
Constants inherited from DiasporaFederation::Entity
DiasporaFederation::Entity::ENTITY_NAME_REGEX, DiasporaFederation::Entity::INVALID_XML_REGEX
Instance Attribute Summary collapse
-
#author ⇒ String
readonly
The old diaspora* ID of the person who changes their ID.
-
#profile ⇒ Person
readonly
Holds new updated profile of a person, including diaspora* ID.
-
#signature ⇒ String
readonly
Signature that validates original and target diaspora* IDs with the new key of person.
Class Method Summary collapse
-
.from_hash(*args) ⇒ Object
Calls super and additionally does signature verification for the instantiated entity.
Instance Method Summary collapse
-
#to_s ⇒ String
String representation of this object.
-
#verify_signature ⇒ Object
Shortcut for calling super method with sensible arguments.
Methods included from Signable
Methods included from Logging
Methods inherited from DiasporaFederation::Entity
class_name, entity_class, entity_name, 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
Constructor Details
This class inherits a constructor from DiasporaFederation::Entity
Instance Attribute Details
#author ⇒ String (readonly)
The old diaspora* ID of the person who changes their ID
14 |
# File 'lib/diaspora_federation/entities/account_migration.rb', line 14 property :author, :string |
#profile ⇒ Person (readonly)
Holds new updated profile of a person, including diaspora* ID
19 |
# File 'lib/diaspora_federation/entities/account_migration.rb', line 19 entity :profile, Entities::Profile |
#signature ⇒ String (readonly)
Signature that validates original and target diaspora* IDs with the new key of person
24 |
# File 'lib/diaspora_federation/entities/account_migration.rb', line 24 property :signature, :string, default: nil |
Class Method Details
.from_hash(*args) ⇒ Object
Calls super and additionally does signature verification for the instantiated entity.
41 42 43 |
# File 'lib/diaspora_federation/entities/account_migration.rb', line 41 def self.from_hash(*args) super.tap(&:verify_signature) end |
Instance Method Details
#to_s ⇒ String
Returns string representation of this object.
27 28 29 |
# File 'lib/diaspora_federation/entities/account_migration.rb', line 27 def to_s "AccountMigration:#{}:#{profile.}" end |
#verify_signature ⇒ Object
Shortcut for calling super method with sensible arguments
34 35 36 |
# File 'lib/diaspora_federation/entities/account_migration.rb', line 34 def verify_signature super(profile., :signature) end |