Module: Roda::RodaPlugins::BridgetownWebfinger::ResponseMethods
- Defined in:
- lib/roda/plugins/bridgetown_webfinger.rb
Overview
Methods included in to the Roda response
Instance Method Summary collapse
-
#webfinger_error(message, status:) ⇒ String
private
Renders an error in the style of Bridgetown Webfinger.
-
#webfinger_success(jrd) ⇒ String
private
Renders a JSON Resource Descriptor for Webfinger.
Instance Method Details
#webfinger_error(message, status:) ⇒ String
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.
Renders an error in the style of Bridgetown Webfinger
125 126 127 128 129 130 |
# File 'lib/roda/plugins/bridgetown_webfinger.rb', line 125 def webfinger_error(, status:) self["Content-Type"] = "application/json" self.status = status JSON.pretty_generate({error: }) end |
#webfinger_success(jrd) ⇒ String
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.
Renders a JSON Resource Descriptor for Webfinger
139 140 141 142 143 |
# File 'lib/roda/plugins/bridgetown_webfinger.rb', line 139 def webfinger_success(jrd) self["Content-Type"] = "application/jrd+json" JSON.pretty_generate(jrd.to_h) end |