glitch-soc/lib/mastodon/extensions.rb
Surinna Curtis f02150468b Expose an /api/v1/extensions endpoint.
We don't have any extensions listed or link this in the "endpoints" field on
actors yet. The endpoint also doesn't currently provide a way to expose any
additional metadata about an extension beyond its URL (in part because the
SWICG proposal currently doesn't include that).

We can add extensions to the endpoint's response by calling
Mastodon::Extension::register with the extension URL.
2017-09-23 20:50:46 +00:00

18 lines
220 B
Ruby

class Mastodon::Extension
@@extensions = []
def self.register url
@extensions << Extension.new(url)
end
def self.all
@extensions
end
def initialize url
@url = url
end
attr_reader :url
end