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) ⇒ 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>/`

Since:

  • 15.1



23
24
25
26
27
28
29
# File 'lib/pageflow/entry_type.rb', line 23

def initialize(name:, frontend_app:, editor_fragment_renderer:, configuration:, editor_app: nil)
  @name = name
  @frontend_app = frontend_app
  @editor_fragment_renderer = editor_fragment_renderer
  @configuration = configuration
  @editor_app = editor_app
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