Class: Deas::Template::Partial

Inherits:
Deas::Template show all
Defined in:
lib/deas/template.rb

Instance Attribute Summary

Attributes inherited from Deas::Template

#name, #options

Instance Method Summary collapse

Methods inherited from Deas::Template

#render

Constructor Details

#initialize(sinatra_call, name, locals = nil) ⇒ Partial

Returns a new instance of Partial.



66
67
68
69
70
71
72
73
# File 'lib/deas/template.rb', line 66

def initialize(sinatra_call, name, locals = nil)
  options = { :locals => (locals || {}) }
  name = begin
    basename = File.basename(name.to_s)
    name.to_s.sub(/#{basename}\Z/, "_#{basename}")
  end
  super sinatra_call, name, options
end