Class: DcRenderer
- Inherits:
-
Object
- Object
- DcRenderer
- Defined in:
- app/helpers/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 |
# File 'app/helpers/dc_renderer.rb', line 33 def initialize( parent, opts={} ) @parent = parent @opts = opts @css = '' self end |
Instance Method Details
#render_css ⇒ Object
Return CSS part of code.
53 54 55 |
# File 'app/helpers/dc_renderer.rb', line 53 def render_css @css end |
#render_html ⇒ Object
Renderer dispatcher. Method returns HTML part of code.
43 44 45 46 47 48 |
# File 'app/helpers/dc_renderer.rb', line 43 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 |