Class: Charming::Presentation::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



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

def handler
  @handler
end

#pathObject (readonly)

Returns the value of attribute path

Returns:

  • (Object)

    the current value of path



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

def path
  @path
end

Instance Method Details

#render(view) ⇒ Object

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



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

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