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



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

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

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

Gets the Default Editor Interface

Parameters:

  • space_id (String)
  • content_type_id (String)
  • params (Hash)

Returns:

See Also:

  • For complete option list: http://docs.contentfulcda.apiary.io/#reference/search-parameters


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

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



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

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

Instance Method Details

#destroyObject

Destroys an EditorInterface.

Not Supported



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

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:



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

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