闭社主体 forked from https://github.com/tootsuite/mastodon
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
506 B

  1. # frozen_string_literal: true
  2. class REST::InstanceSerializer < ActiveModel::Serializer
  3. attributes :uri, :title, :description, :email,
  4. :version, :urls
  5. def uri
  6. Rails.configuration.x.local_domain
  7. end
  8. def title
  9. Setting.site_title
  10. end
  11. def description
  12. Setting.site_description
  13. end
  14. def email
  15. Setting.site_contact_email
  16. end
  17. def version
  18. Mastodon::Version.to_s
  19. end
  20. def urls
  21. { streaming_api: Rails.configuration.x.streaming_api_base_url }
  22. end
  23. end