Class: Dossier::Result::Formatted
Instance Attribute Summary
#adapter_results, #report
Instance Method Summary
collapse
#arrays, #body, #footers, #hashes, #initialize, #raw_headers, #row_hash, #rows
Instance Method Details
#each ⇒ Object
62
63
64
|
# File 'lib/dossier/result.rb', line 62
def each
adapter_results.rows.each { |row| yield format(row) }
end
|
66
67
68
69
70
71
72
73
74
75
|
# File 'lib/dossier/result.rb', line 66
def format(row)
unless row.kind_of?(Enumerable)
raise ArgumentError.new("#{row.inspect} must be a kind of Enumerable")
end
displayable_columns(row).map { |value, i|
column = .at(i)
apply_formatter(row, column, value)
}
end
|
54
55
56
57
58
59
60
|
# File 'lib/dossier/result.rb', line 54
def
@formatted_headers ||= .select { |h|
report.display_column?(h)
}.map { |h|
report.(h)
}
end
|