class PT::DataRow

Attributes

num[RW]
owners[RW]
record[RW]
state[RW]

Public Class Methods

new(orig, dataset) click to toggle source
# File lib/pt/data_row.rb, line 8
def initialize(orig, dataset)
  @record = orig
  @num = dataset.index(orig) + 1
  if defined? orig.current_state
    @state = orig.current_state
  end

  if defined? orig.owners
    @owners = orig.owners.map(&:initials).join(',')
  end
end

Public Instance Methods

method_missing(method) click to toggle source
# File lib/pt/data_row.rb, line 20
def method_missing(method)
  str = @record.send(method).to_s
  str.respond_to?(:force_encoding) ? str.force_encoding('utf-8') : Iconv.iconv('UTF-8', 'UTF-8', str)
end
to_s() click to toggle source
# File lib/pt/data_row.rb, line 25
def to_s
  @record.send(self.to_s_attribute)
end
to_s_attribute() click to toggle source
# File lib/pt/data_row.rb, line 29
def to_s_attribute
  @n.to_s
end