Class: Dato::Site::Repo::Site

Inherits:
Base
  • Object
show all
Defined in:
lib/dato/site/repo/site.rb

Instance Attribute Summary

Attributes inherited from Base

#client

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Dato::Site::Repo::Base

Instance Method Details

#findObject



8
9
10
# File 'lib/dato/site/repo/site.rb', line 8

def find
  get_request '/site'
end

#update(resource_attributes) ⇒ Object



12
13
14
15
16
17
18
19
# File 'lib/dato/site/repo/site.rb', line 12

def update(resource_attributes)
  body = JsonApiSerializer.new(
    type: :site,
    attributes: %i(deploy_adapter deploy_settings favicon frontend_url global_seo locales name no_index ssg theme_hue timezone)
  ).serialize(resource_attributes)

  put_request '/site', body
end