Class: Contentful::Management::EditorInterface

Inherits:
Object
  • Object
show all
Includes:
Resource, Resource::Refresher, Resource::SystemProperties
Defined in:
lib/contentful/management/editor_interface.rb

Overview

Resource class for Editor Interface.

Instance Attribute Summary

Attributes included from Resource::SystemProperties

#sys

Attributes included from Resource

#client, #default_locale, #properties, #raw_object, #request

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Resource::Refresher

#reload

Methods included from Resource

#array?, #fields, #nested_locale_fields?, #resource?, #sys

Class Method Details

.createObject

Creates an EditorInterface.

Not Supported



34
35
36
# File 'lib/contentful/management/editor_interface.rb', line 34

def self.create(*)
  fail 'Not supported'
end

.default(client, space_id, content_type_id) ⇒ Contentful::Management::EditorInterface

Gets the Default Editor Interface

Parameters:

Returns:



20
21
22
# File 'lib/contentful/management/editor_interface.rb', line 20

def self.default(client, space_id, content_type_id)
  ClientEditorInterfaceMethodsFactory.new(client).default(space_id, content_type_id)
end

.findObject

Finds an EditorInterface.

Not Supported



27
28
29
# File 'lib/contentful/management/editor_interface.rb', line 27

def self.find(*)
  fail 'Not supported'
end

Instance Method Details

#destroyObject

Destroys an EditorInterface.

Not Supported



69
70
71
# File 'lib/contentful/management/editor_interface.rb', line 69

def destroy
  fail 'Not supported'
end

#update(attributes) ⇒ Contentful::Management::EditorInterface

Updates an Editor Interface

Parameters:

  • attributes (Hash)

Options Hash (attributes):

  • :controls (Array<Hash>)

Returns:



57
58
59
60
61
62
63
64
# File 'lib/contentful/management/editor_interface.rb', line 57

def update(attributes)
  ResourceRequester.new(client, self.class).update(
    self,
    { space_id: space.id, content_type_id: content_type.id, editor_id: id },
    { 'controls' => attributes.fetch(:controls) },
    version: sys[:version]
  )
end