Class: L10nizer::NodeWrapperFactory

Inherits:
Object
  • Object
show all
Defined in:
lib/l10nizer/node.rb

Class Method Summary collapse

Class Method Details

.wrap(node, keygen = nil) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
# File 'lib/l10nizer/node.rb', line 3

def self.wrap(node, keygen=nil)
  case node
  when HtmlErb::Text
    TextNode.new(node, keygen)
  when HtmlErb::Eval
    EvalNode.new(node, keygen)
  when HtmlErb::Word
    WordNode.new(node)
  else
    BasicNode.new(node)
  end
end