Sha256: 2397dad0555faef86d0c9329d6ab2bae6cee1f6e86315678ef9f05d3c420ca57
Contents?: true
Size: 1.27 KB
Versions: 13
Compression:
Stored size: 1.27 KB
Contents
# frozen_string_literal: true xml.Worksheet 'ss:Name' => I18n.t(:tab_tasks) do xml.Table do unless @tasks.empty? # Header. xml.Row do heads = %w[id name due date_created date_updated completed user assigned_to category background_info] heads.each do |head| xml.Cell do xml.Data I18n.t(head), 'ss:Type' => 'String' end end end # Rows. @tasks.map(&:second).flatten.each do |task| xml.Row do data = [task.id, task.name, I18n.t(task.computed_bucket), task.created_at, task.updated_at, task.completed_at, task.user.try(:name), task.assignee.try(:name), task.category, task.background_info] data.each do |value| xml.Cell do xml.Data value, 'ss:Type' => (value.respond_to?(:abs) ? 'Number' : 'String').to_s end end end end end end end
Version data entries
13 entries across 13 versions & 1 rubygems