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 || WebResolver
end

Instance Attribute Details

#_resolverObject

Returns the value of attribute _resolver.



6
7
8
# File 'lib/activitypub/uri.rb', line 6

def _resolver
  @_resolver
end

Instance Method Details

#getObject



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

def get
  @_resolver&.call(self.to_s)
end

#to_jsonObject



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

def to_json(...) = @href

#to_sObject



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

def to_s = @href