Class: Racket::Utils::Views::Renderer

Inherits:
Object
  • Object
show all
Defined in:
lib/racket/utils/views/renderer.rb

Overview

Class responsible for rendering a controller/view/layout combination.

Class Method Summary collapse

Class Method Details

.render(controller, view, layout) ⇒ Array

Renders a page using the provided controller/view and layout combination and returns an response array that can be sent to the client.

Parameters:

Returns:

  • (Array)


39
40
41
42
43
44
# File 'lib/racket/utils/views/renderer.rb', line 39

def self.render(controller, view, layout)
  send_response(
    controller.response,
    view ? render_template(controller, view, layout) : controller.racket.action_result
  )
end

.service(_options = {}) ⇒ Proc

Returns a service proc that can be used by the registry.

Parameters:

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

    (unused)

Returns:

  • (Proc)


28
29
30
# File 'lib/racket/utils/views/renderer.rb', line 28

def self.service(_options = {})
  -> { self }
end