Class: DiasporaFederation::Discovery::Discovery
- Inherits:
-
Object
- Object
- DiasporaFederation::Discovery::Discovery
- Includes:
- Logging
- Defined in:
- lib/diaspora_federation/discovery/discovery.rb
Overview
This class contains the logic to fetch all data for the given diaspora* ID.
Instance Attribute Summary collapse
-
#diaspora_id ⇒ String
readonly
The diaspora* ID of the account.
Instance Method Summary collapse
-
#fetch_and_save ⇒ Person
Fetches all metadata for the account and saves it via callback.
-
#initialize(diaspora_id) ⇒ Discovery
constructor
Creates a discovery class for the diaspora* ID.
Methods included from Logging
Constructor Details
#initialize(diaspora_id) ⇒ Discovery
Creates a discovery class for the diaspora* ID
12 13 14 |
# File 'lib/diaspora_federation/discovery/discovery.rb', line 12 def initialize(diaspora_id) @diaspora_id = clean_diaspora_id(diaspora_id) end |
Instance Attribute Details
#diaspora_id ⇒ String (readonly)
Returns the diaspora* ID of the account.
8 9 10 |
# File 'lib/diaspora_federation/discovery/discovery.rb', line 8 def diaspora_id @diaspora_id end |
Instance Method Details
#fetch_and_save ⇒ Person
Fetches all metadata for the account and saves it via callback
18 19 20 21 22 23 24 25 26 |
# File 'lib/diaspora_federation/discovery/discovery.rb', line 18 def fetch_and_save logger.info "Fetch data for #{diaspora_id}" validate_diaspora_id DiasporaFederation.callbacks.trigger(:save_person_after_webfinger, person) logger.info "successfully webfingered #{diaspora_id}" person end |