Class: Voom::Presenters::WebClient::ComponentDecoratorFactory
- Inherits:
-
Object
- Object
- Voom::Presenters::WebClient::ComponentDecoratorFactory
- Defined in:
- lib/voom/presenters/web_client/component_decorator_factory.rb
Class Method Summary collapse
Class Method Details
.build(component) ⇒ Object
8 9 10 11 12 13 14 15 16 |
# File 'lib/voom/presenters/web_client/component_decorator_factory.rb', line 8 def self.build(component) comp_class = "#{inflector.camelize(component.type)}HtmlDecorator" klass = if const_defined?(comp_class) const_get(comp_class) else ComponentHtmlDecorator end klass.new(component) end |