Class: ActivityPub::URI

Inherits:
Object
  • Object
show all
Defined in:
lib/activitypub/uri.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(href, resolver: nil) ⇒ URI

Returns a new instance of URI.



8
9
10
11
# File 'lib/activitypub/uri.rb', line 8

def initialize(href, resolver: nil)
  @href = href
  @_resolver = resolver
end

Instance Attribute Details

#_resolverObject



13
# File 'lib/activitypub/uri.rb', line 13

def _resolver = (@_resolver || WebResolver)

Instance Method Details

#getObject



18
# File 'lib/activitypub/uri.rb', line 18

def get = _resolver.call(self.to_s)

#to_jsonObject



16
# File 'lib/activitypub/uri.rb', line 16

def to_json(...) = @href

#to_sObject



15
# File 'lib/activitypub/uri.rb', line 15

def to_s = @href