Class: Rmobio::Rxml::TransformerFactory

Inherits:
Object
  • Object
show all
Defined in:
lib/rmobio/rxml/transformer_factory.rb

Class Method Summary collapse

Class Method Details

.get_transformer(client) ⇒ Object

Return a transformer instance based on the client type. Available transformer for the following client types:

xhtml, html, wap and xf (Mobio xforms)


28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/rmobio/rxml/transformer_factory.rb', line 28

def TransformerFactory::get_transformer(client) 
  kclass = BaseTransformer
  kclass = 
    case client 
  when 'xf'
    XformsTransformer
  when 'xhtml'
    #XhtmlTransformer
    BaseTransformer
  when 'html'
    HtmlTransformer 
  when 'wap'
    WapTransformer
  end 
  RAILS_DEFAULT_LOGGER.debug('getting transformer instance for client ' + client) 
  #kclass::get_instance()    
  kclass::instance 
end