Class: UDRS::Renderers::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/udrs/renderers/base.rb

Direct Known Subclasses

ESCPRenderer, PDFRenderer

Instance Method Summary collapse

Instance Method Details

#render_item(item) ⇒ Object



4
5
6
7
8
# File 'lib/udrs/renderers/base.rb', line 4

def render_item(item)
	method_name = "render_#{item.class.name.demodulize.underscore}"
	fail NotImplementedError, "Cannot render #{item.class.name}" unless respond_to?(method_name, true)
	method(method_name).call(item)
end