Class: Nyara::View::TiltRenderable

Inherits:
Object
  • Object
show all
Defined in:
lib/nyara/view.rb

Instance Method Summary collapse

Constructor Details

#initialize(tilt) ⇒ TiltRenderable

Returns a new instance of TiltRenderable.


104
105
106
# File 'lib/nyara/view.rb', line 104

def initialize tilt
  @tilt = tilt
end

Instance Method Details

#bind(instance) ⇒ Object


108
109
110
111
# File 'lib/nyara/view.rb', line 108

def bind instance
  @instance = instance
  self
end

#call(locals = nil, &p) ⇒ Object


113
114
115
116
117
# File 'lib/nyara/view.rb', line 113

def call locals=nil, &p
  inst = @instance
  @instance = nil
  @tilt.render inst, locals, &p
end