Class: Bridgetown::Webfinger::Builder::StaticFile
- Inherits:
-
GeneratedPage
- Object
- GeneratedPage
- Bridgetown::Webfinger::Builder::StaticFile
- Defined in:
- lib/bridgetown/webfinger/builder.rb
Overview
The static Webfinger file to serve
Instance Attribute Summary collapse
-
#jrd ⇒ JRD
readonly
private
The JRD forming the data model for the static Webfinger page.
-
#subject ⇒ String
readonly
private
The subject of the JRD.
Instance Method Summary collapse
-
#initialize(site, account:, data:, host:) ⇒ void
constructor
private
Initializes a new static Webfinger file.
Constructor Details
#initialize(site, account:, data:, host:) ⇒ void
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Initializes a new static Webfinger file
106 107 108 109 110 111 112 113 |
# File 'lib/bridgetown/webfinger/builder.rb', line 106 def initialize(site, account:, data:, host:) super(site, __dir__, "/.well-known", "webfinger", from_plugin: true) @subject = URI::Acct.build({account: account, host: host}).to_s @jrd = JRD.parse(@subject, data.webfinger) self.content = JSON.pretty_generate(@jrd.to_h) end |
Instance Attribute Details
#jrd ⇒ JRD (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
The JRD forming the data model for the static Webfinger page
121 122 123 |
# File 'lib/bridgetown/webfinger/builder.rb', line 121 def jrd @jrd end |
#subject ⇒ String (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
The subject of the JRD
129 130 131 |
# File 'lib/bridgetown/webfinger/builder.rb', line 129 def subject @subject end |