Class: Pageflow::EntryType

Inherits:
Object
  • Object
show all
Defined in:
lib/pageflow/entry_type.rb

Overview

Captures details of how to render entries of a certain type

Since:

  • 15.1

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:, frontend_app:, editor_fragment_renderer:, configuration:, editor_app: nil, theme_files: {}, web_app_manifest: nil) ⇒ EntryType

Returns a new instance of EntryType.

Parameters:

  • name (String)

    A unique name.

  • frontend_app (#call)

    A rack app that renders the entry when not in the editor (i.e. preview and published entries).

  • editor_fragment_renderer (PartialEditorFragmentRenderer)

    Inject content into editor HTML and JSON seed templates.

  • configuration (Class)

    Class including Configuration::EntryTypeConfiguration.

  • editor_app (#call) (defaults to: nil)

    A rack app that extends the REST interface used by editor Backbone collections. Mounted at ‘/editor/entries/:id/<entry_type_name>/`

  • theme_files (Hash) (defaults to: {})

    A hash of the following form defining what files can be uploaded when customizing themes of the entry type and which Paperclip styles shall be processed: ‘{content_type: %r{^image/, styles: ’300x300>‘}`.

  • web_app_manifest (#call) (defaults to: nil)

    Receives published entry and returns JSON for webmanifest file.

Since:

  • 15.1



33
34
35
36
37
38
39
40
41
42
# File 'lib/pageflow/entry_type.rb', line 33

def initialize(name:, frontend_app:, editor_fragment_renderer:, configuration:, editor_app: nil,
               theme_files: {}, web_app_manifest: nil)
  @name = name
  @frontend_app = frontend_app
  @editor_fragment_renderer = editor_fragment_renderer
  @configuration = configuration
  @editor_app = editor_app
  @theme_files = theme_files
  @web_app_manifest = web_app_manifest
end

Instance Attribute Details

#configurationObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 15.1



7
8
9
# File 'lib/pageflow/entry_type.rb', line 7

def configuration
  @configuration
end

#editor_appObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 15.1



7
8
9
# File 'lib/pageflow/entry_type.rb', line 7

def editor_app
  @editor_app
end

#editor_fragment_rendererObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 15.1



7
8
9
# File 'lib/pageflow/entry_type.rb', line 7

def editor_fragment_renderer
  @editor_fragment_renderer
end

#frontend_appObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 15.1



7
8
9
# File 'lib/pageflow/entry_type.rb', line 7

def frontend_app
  @frontend_app
end

#nameObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 15.1



7
8
9
# File 'lib/pageflow/entry_type.rb', line 7

def name
  @name
end

#theme_filesObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 15.1



7
8
9
# File 'lib/pageflow/entry_type.rb', line 7

def theme_files
  @theme_files
end

#web_app_manifestObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 15.1



7
8
9
# File 'lib/pageflow/entry_type.rb', line 7

def web_app_manifest
  @web_app_manifest
end