Class: Charming::Templates::ResolvedTemplate

Inherits:
Data
  • Object
show all
Defined in:
lib/charming/presentation/templates.rb

Overview

A resolved template: an on-disk path paired with the handler responsible for rendering it.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#handlerObject (readonly)

Returns the value of attribute handler

Returns:

  • (Object)

    the current value of handler



10
11
12
# File 'lib/charming/presentation/templates.rb', line 10

def handler
  @handler
end

#pathObject (readonly)

Returns the value of attribute path

Returns:

  • (Object)

    the current value of path



10
11
12
# File 'lib/charming/presentation/templates.rb', line 10

def path
  @path
end

Instance Method Details

#render(view) ⇒ Object

Renders the template against view by delegating to the registered handler.



12
13
14
# File 'lib/charming/presentation/templates.rb', line 12

def render(view)
  handler.render(path, view)
end