Class: ActivityPub::WebFingerResult
- Inherits:
-
Object
- Object
- ActivityPub::WebFingerResult
- Defined in:
- lib/activitypub/webfinger.rb
Instance Method Summary collapse
- #[](i) ⇒ Object
- #activitypub ⇒ Object
-
#initialize(hash) ⇒ WebFingerResult
constructor
A new instance of WebFingerResult.
Constructor Details
#initialize(hash) ⇒ WebFingerResult
Returns a new instance of WebFingerResult.
6 7 8 9 10 11 12 13 14 15 |
# File 'lib/activitypub/webfinger.rb', line 6 def initialize(hash) @h = hash @h["aliases"] = @h["aliases"].map{ ActivityPub::URI.new(_1) } @h["links"].each do |v| if v["href"] v["href"] = ActivityPub::URI.new(v["href"]) end end end |
Instance Method Details
#[](i) ⇒ Object
17 |
# File 'lib/activitypub/webfinger.rb', line 17 def[](i) = @h[i] |
#activitypub ⇒ Object
19 20 21 |
# File 'lib/activitypub/webfinger.rb', line 19 def activitypub @activitypub ||= self["links"].find{ _1["rel"] == "self" && _1["type"] == "application/activity+json" }&.dig("href") end |