Class: Factory
- Inherits:
-
Object
- Object
- Factory
- Defined in:
- lib/diml/elements/factory.rb
Overview
Element is a concrete implementation of Element It is used in conjunction with a ContentTree and is renderable
Class Method Summary collapse
-
.new_element(content) ⇒ Object
Factory method for creating the appropriate class under the hood via the token.
Class Method Details
.new_element(content) ⇒ Object
Factory method for creating the appropriate class under the hood via the token
10 11 12 13 14 15 16 |
# File 'lib/diml/elements/factory.rb', line 10 def self.new_element(content) if Keywords.is_kw?(content) Keywords.build_from(content) else Content.new(content) end end |