Class: Wee::Presenter

Inherits:
Object show all
Defined in:
lib/wee/presenter.rb

Overview

Presenter is the superclass of all classes that want to participate in rendering and callback-processing. It merely specifies an interface without actual implementation.

Class Component and Decoration are it’s two most important subclasses.

Direct Known Subclasses

Component, Decoration

Instance Method Summary collapse

Instance Method Details

#process_callbacks(callbacks) ⇒ Object



19
# File 'lib/wee/presenter.rb', line 19

def process_callbacks(callbacks); raise end

#render(r) ⇒ Object



16
# File 'lib/wee/presenter.rb', line 16

def render(r); raise end

#render_on(r) ⇒ Object



12
13
14
# File 'lib/wee/presenter.rb', line 12

def render_on(r)
  r.with(self) {|new_r| render(new_r)}
end

#renderer_classObject

Returns the class used as Renderer for this presenter. Overwrite this method if you want to use a different Renderer than the default one.

Returned class must be a subclass of Wee::Renderer.



27
28
29
# File 'lib/wee/presenter.rb', line 27

def renderer_class
  Wee::DefaultRenderer
end

#state(s) ⇒ Object



17
# File 'lib/wee/presenter.rb', line 17

def state(s); raise end