API / Entities

RenderableEntity

Represents the component or view template partial that is being rendered in a preview.

Instance Methods

Components

# component? → Boolean

Whether or not the renderable is a component (as opposed to a view template/partial).

# component_class → Class

The associated component class (if the renderable is a component).

# inline? → Boolean

Whether or not the renderable is a component without a template.

# template? → Boolean

Whether or not the renderable is a view template/partial (as opposed to a component).

Identity

# id → String

Human-readable unique ID for the entity.

# label → String

Titlized name for use in navigation etc.

Can be customized using the @label tag where supported.

# name → String

Parameter-safe entity name.

# type → Symbol

Entity type identifier. Returns :component for components and :template for view templates/partials.

Paths

# directory_path → Pathname

Full directory path for the entity file.

Aliases:

#dir_path
# file_extension → String

Extension of the entity file.

# file_name (strip_ext = false) → String

Name of the entity file.

Includes file extension unless the strip_ext argument is true.

Arguments:

strip_ext Boolean

Whether or not to remove the file extension

# file_path → Pathname

Full path to the entity file.

Aliases:

#full_path
# last_modified → Time

Time that the entity file was last modified.

# lookup_path → String

Canonical reference path.

Used for generating URL paths and looking up entities.

Aliases:

#path
# relative_directory_path → Pathname

Relative directory path for the entity file.

Returned path is relative to the appropriate base directory (i.e. the preview directory for previews).

# relative_file_path → Pathname

Relative path to the entity file.

Returned path is relative to the appropriate base directory (i.e. the preview directory for previews).

Aliases:

#rel_path
# template_file_path → Class

Full path to the component template (if present) or view template/partial.

Other

# <=> (other)

No description available.

User Guide

Extending Lookbook

API

Elsewhere