Sha256: 31310c8a83527e72ee3e9b2b5aa9d502ba3c849ec7290b2b1fefd541c56e9dbd

Contents?: true

Size: 1.16 KB

Versions: 2

Compression:

Stored size: 1.16 KB

Contents

# frozen_string_literal: true

require_relative 'editor_interface'
require_relative 'client_association_methods_factory'

module Contentful
  module Management
    # Wrapper for EditorInterface API for usage from within Client
    # @private
    class ClientEditorInterfaceMethodsFactory
      attr_reader :client

      def initialize(client, space_id, environment_id, content_type_id)
        @client = client
        @resource_requester = ResourceRequester.new(client, associated_class)
        @space_id = space_id
        @environment_id = environment_id
        @content_type_id = content_type_id
      end

      # Gets the Default Editor Interface
      #
      # @see _ For complete option list: https://www.contentful.com/developers/docs/references/content-delivery-api/#/reference/search-parameters
      #
      # @return [Contentful::Management::EditorInterface]
      def default
        @resource_requester.all(
          space_id: @space_id,
          environment_id: @environment_id,
          content_type_id: @content_type_id,
          editor_id: 'default'
        )
      end

      private

      def associated_class
        EditorInterface
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
contentful-management-3.10.0 lib/contentful/management/client_editor_interface_methods_factory.rb
contentful-management-3.9.0 lib/contentful/management/client_editor_interface_methods_factory.rb