Class: Kwartz::Converter

Inherits:
Object
  • Object
show all
Includes:
ConverterHelper, StatementHelper
Defined in:
lib/kwartz/converter.rb

Overview

(abstract) covnert presentation data into list of Statement.

Direct Known Subclasses

TextConverter

Constant Summary collapse

@@class_table =
{}

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from StatementHelper

#add_foreach_stmts, #add_native_code, #add_native_expr_with_default, #build_print_args, #build_print_expr_stmt, #build_print_stmt, #create_text_print_stmt, #etag_stmt, #stag_stmt, #wrap_content_with_native_stmt, #wrap_element_with_native_stmt

Methods included from ConverterHelper

#_last_stmt_kind, #convert_error, #error_if_empty_tag, #error_when_last_stmt_is_not_if, #include_properties

Constructor Details

#initialize(handler, properties = {}) ⇒ Converter

Returns a new instance of Converter.



816
817
818
819
# File 'lib/kwartz/converter.rb', line 816

def initialize(handler, properties={})
  @handler = handler
  @handler.converter = self
end

Instance Attribute Details

#handlerObject (readonly)

, :dattr, :input



821
822
823
# File 'lib/kwartz/converter.rb', line 821

def handler
  @handler
end

Class Method Details

.get_class(style) ⇒ Object



838
839
840
# File 'lib/kwartz/converter.rb', line 838

def self.get_class(style)
  return @@class_table[style]
end

.register_class(style, klass) ⇒ Object



833
834
835
# File 'lib/kwartz/converter.rb', line 833

def self.register_class(style, klass)
  @@class_table[style] = klass
end

Instance Method Details

#convert(input, filename = '') ⇒ Object

(abstract) convert string into list of Statement.



825
826
827
# File 'lib/kwartz/converter.rb', line 825

def convert(input, filename='')
  not_implemented
end