Module: DeclarativeGrid::Renderers
- Included in:
- Base
- Defined in:
- lib/declarative_grid/renderers.rb,
lib/declarative_grid/renderers/csv.rb,
lib/declarative_grid/renderers/html.rb,
lib/declarative_grid/renderers/abstract_renderer.rb
Defined Under Namespace
Classes: AbstractRenderer, Csv, Html
Instance Method Summary collapse
-
#renderer(name, options = {}) ⇒ Object
Define a renderer.
-
#renderer_classes ⇒ Object
Renderer Classes.
Instance Method Details
#renderer(name, options = {}) ⇒ Object
Define a renderer
9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/declarative_grid/renderers.rb', line 9 def renderer(name, = {}) klass = Class.new begin case k = .delete(:class) when Class then k when String then k.camelize.constantize else "declarative_grid/renderers/#{k || name}".camelize.constantize end end klass.grid_class = self klass..merge! self.renderer_classes[name] = klass end |
#renderer_classes ⇒ Object
Renderer Classes
4 5 6 |
# File 'lib/declarative_grid/renderers.rb', line 4 def renderer_classes @renderer_classes ||= {} end |