class Tempo::Views::ViewRecords::Log

Base Composite log class, used for extending views for any child of Tempo::Model::Log Inherits the id, and type from ViewRecords::Model, and adds an start time and date_id.

The Log View Model is an abstract model that is extended to create views for children of the Log Model class. See ViewRecords::TimeRecord for an example.

Attributes

d_id[RW]
start_time[RW]

Public Class Methods

new(model, options={}) click to toggle source
Calls superclass method Tempo::Views::ViewRecords::Model::new
# File lib/tempo/views/view_records/log.rb, line 15
def initialize(model, options={})
  super model, options
  @start_time = model.start_time
  @d_id = model.d_id
end

Public Instance Methods

format(&block) click to toggle source
# File lib/tempo/views/view_records/log.rb, line 21
def format(&block)
  block ||= lambda {|model| "#{ model.type.capitalize} #{model.d_id}-#{model.id} #{model.start_time.strftime('%H:%M')}"}
  block.call self
end