Class: Lifer::Builder::HTML::FromAny

Inherits:
Object
  • Object
show all
Defined in:
lib/lifer/builder/html/from_any.rb

Overview

A base class for all HTML builder adapters. The methods provided by this class are either required or reusable by builder subclasses. See the committed HTML builder adapter classes for example implementations.

Direct Known Subclasses

FromERB, FromLiquid

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.build(entry:) ⇒ String

Build and render an entry.

Parameters:

Returns:

  • (String)

    The rendered entry.



12
13
14
# File 'lib/lifer/builder/html/from_any.rb', line 12

def build(entry:)
  new(entry: entry).render
end

Instance Method Details

#renderObject

The base class does not provide a render method, but any subclass should be expected to.

Raises:

  • (NotImplementedError)


21
22
23
24
# File 'lib/lifer/builder/html/from_any.rb', line 21

def render
  raise NotImplementedError,
    "subclasses must implement a custom `#render` method"
end