Class: Tempo::Views::Formatters::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/tempo/views/formatters/base.rb

Direct Known Subclasses

Screen

Instance Method Summary collapse

Instance Method Details

#format_records(records, options = {}) ⇒ Object

Here we check if our class methods include a proc block to handle the particular record type. See View Records for all possible record types. See screen formatter for examples of proc blocks.



20
21
22
23
24
25
26
# File 'lib/tempo/views/formatters/base.rb', line 20

def format_records(records, options={})
  @options = options
  records.each do |record|
    class_block = "#{record.type}_block"
    send( class_block, record ) if respond_to? class_block
  end
end