-
-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathroot_metadata.rb
More file actions
41 lines (38 loc) · 1.08 KB
/
root_metadata.rb
File metadata and controls
41 lines (38 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# frozen_string_literal: true
module Html2rss
module Web
module Api
module V1
##
# Builds the public metadata payload for the API root endpoint.
module RootMetadata
class << self
# @param router [Roda::RodaRequest]
# @return [Hash{Symbol=>Object}]
def build(router)
{
api: {
name: 'html2rss-web API',
description: 'RESTful API for converting websites to RSS feeds',
openapi_url: "#{router.base_url}/openapi.yaml"
},
instance: instance_payload(router)
}
end
private
# @param _router [Roda::RodaRequest]
# @return [Hash{Symbol=>Object}]
def instance_payload(_router)
{
feed_creation: {
enabled: AutoSource.enabled?,
access_token_required: AutoSource.enabled?
}
}
end
end
end
end
end
end
end