Class: DcRenderer
- Inherits:
-
Object
- Object
- DcRenderer
- Defined in:
- app/renderers/dc_renderer.rb
Overview
This is abstract renderer class definition which can be reused by other renders.
Direct Known Subclasses
Instance Method Summary collapse
-
#initialize(parent, opts = {}) ⇒ DcRenderer
constructor
Object initialization.
-
#render_css ⇒ Object
Return CSS part of code.
-
#render_html ⇒ Object
Renderer dispatcher.
Constructor Details
#initialize(parent, opts = {}) ⇒ DcRenderer
Object initialization.
33 34 35 36 37 38 39 |
# File 'app/renderers/dc_renderer.rb', line 33 def initialize( parent, opts={} ) @parent = parent @page = parent.page @opts = opts @css = '' self end |
Instance Method Details
#render_css ⇒ Object
Return CSS part of code.
54 55 56 |
# File 'app/renderers/dc_renderer.rb', line 54 def render_css @css end |
#render_html ⇒ Object
Renderer dispatcher. Method returns HTML part of code.
44 45 46 47 48 49 |
# File 'app/renderers/dc_renderer.rb', line 44 def render_html can_view, msg = @parent.dc_user_can_view(@parent, @parent.page) return msg unless can_view method = @opts[:method] || 'default' respond_to?(method) ? send(method) : "#{self.class}: Method (#{method}) not defined!" end |