Class: Eskimo::Renderer

Inherits:
Object
  • Object
show all
Defined in:
lib/eskimo/renderer.rb

Overview

Render a component or a list of ones.

Instance Method Summary collapse

Constructor Details

#initialize(**props) ⇒ Renderer

Returns a new instance of Renderer

Parameters:

  • props (Hash)

    Properties to pass to each component being rendered.



8
9
10
# File 'lib/eskimo/renderer.rb', line 8

def initialize(**props)
  @props = { **props, render: method(:render) }
end

Instance Method Details

#apply(&components) ⇒ Object

Parameters:

  • components (Proc)

    A block that returns components to render.



14
15
16
# File 'lib/eskimo/renderer.rb', line 14

def apply(&components)
  render(components)
end